Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2004
    Posts
    45

    Unanswered: if..then statement within a loop

    hallo,
    I have this code:

    k = 1
    g = 4

    Do Until rs3.EOF
    uRow3 = rs3(i3 + 3)
    If Sht.Cells(k, g).Value = uRow3 Then
    Sht.Cells(k, g).Value = rs3(i3 + 4)
    rs3.MoveNext
    Else
    k = k + 1
    Loop

    But it doesn't work: debugger tells me that there is a loop without a do. Do you have an idea?

  2. #2
    Join Date
    Sep 2002
    Location
    South Wales
    Posts
    580
    Do Until rs3.EOF

    uRow3 = rs3(i3 + 3)

    If Sht.Cells(k, g).Value = uRow3 Then

    Sht.Cells(k, g).Value = rs3(i3 + 4)

    rs3.MoveNext

    Else

    k = k + 1

    End if '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Loop
    Windows Server 2003-8 / Terminal Services / SQL 2000 / Access 2003 / Office 2003-7 / Exchange 2003-7 / Blackberry Enterprise Server / AutoCAD / Lambert And Butler / Red Bull

  3. #3
    Join Date
    Feb 2004
    Posts
    45

    Talking

    aaaaaaaaaahhhhhhhhh


    thanks

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by garethdart
    Do Until rs3.EOF

    uRow3 = rs3(i3 + 3)

    If Sht.Cells(k, g).Value = uRow3 Then

    Sht.Cells(k, g).Value = rs3(i3 + 4)

    rs3.MoveNext

    Else

    k = k + 1

    End if '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Loop
    This isn't "C" you know ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •