Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Posts
    123

    Unanswered: Jumping to next record in With...End

    While in a With...End statement, how do I stop working on the current record and jump to the next if I encounter an "error". For instance, while cycling through several records I encounter an important field that is blank/needed, I want to exit the With for that record and jump to rcd.MoveNext

    {--Access 97--}
    Do Until rcd.EOF
    With rcd
    If IsNull(rcd!IMPORTANT_FIELD) Then
    Exit With (? jump down to rcd.MoveNext)
    Else
    End If
    .Edit
    !TOTALS = 25 * rcd!IMPORTANT_FIELD
    .Update
    End With
    rcd.MoveNext
    Loop

  2. #2
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Re: Jumping to next record in With...End

    There is no such thing like "Exit With". You must remember that With..End With is not a loop struture. What you do is use goto. check help files on "goto".


    Originally posted by jrn0074
    While in a With...End statement, how do I stop working on the current record and jump to the next if I encounter an "error". For instance, while cycling through several records I encounter an important field that is blank/needed, I want to exit the With for that record and jump to rcd.MoveNext

    {--Access 97--}
    Do Until rcd.EOF
    With rcd
    If IsNull(rcd!IMPORTANT_FIELD) Then
    Exit With (? jump down to rcd.MoveNext)
    Else
    End If
    .Edit
    !TOTALS = 25 * rcd!IMPORTANT_FIELD
    .Update
    End With
    rcd.MoveNext
    Loop

Posting Permissions

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