The following code segement is behind a button on a form. There is a function call within the loop that changes some data on the form. This code works perfectly except that it only scrolls through 25 of the 2000+ records. Is there an easy way to fix this code without a rewrite?
Private Sub Command0_Click()
On Error GoTo MemFiles_ERR
Dim Endmark As String
Dim Currentmark As String
Dim varCustomer As String
DoCmd.GoToRecord , , acLast
Endmark = Me.Bookmark
DoCmd.GoToRecord , , acFirst
Do
Currentmark = Me.Bookmark
If Not (IsNull(txtCustomer)) Then
varCustomer = GetCustomer(txtCustomer)
If Not (varCustomer = "<none>"
Then
txtCustomer = varCustomer
End If
End If
If Currentmark = Endmark Then
Exit Do
End If
DoCmd.GoToRecord , , acNext
Loop
DoCmd.GoToRecord , , acFirst
MsgBox "Data conversion complete"
Exit Sub
MemFiles_ERR:
MsgBox "Something hosed..."
End Sub
A+, N+, MCP
Private Sub Command0_Click()
On Error GoTo MemFiles_ERR
Dim Endmark As String
Dim Currentmark As String
Dim varCustomer As String
DoCmd.GoToRecord , , acLast
Endmark = Me.Bookmark
DoCmd.GoToRecord , , acFirst
Do
Currentmark = Me.Bookmark
If Not (IsNull(txtCustomer)) Then
varCustomer = GetCustomer(txtCustomer)
If Not (varCustomer = "<none>"
txtCustomer = varCustomer
End If
End If
If Currentmark = Endmark Then
Exit Do
End If
DoCmd.GoToRecord , , acNext
Loop
DoCmd.GoToRecord , , acFirst
MsgBox "Data conversion complete"
Exit Sub
MemFiles_ERR:
MsgBox "Something hosed..."
End Sub
A+, N+, MCP