rupes_mahal
Registered User.
- Local time
- Today, 00:00
- Joined
- Aug 12, 2001
- Messages
- 60
hi..
I have created a command button using the wizard to go to the next record. It works. But the problem is, if i have 2 records already there, and click on next record, when im on record 2. It goes to a new blank record. I dont want it to do that. I want it to stop at the last record which has data in it, not to go to a new record. I have the VB code for it:
Private Sub NextRecord_Click()
On Error GoTo Err_NextRecord_Click
DoCmd.GoToRecord , , acNext
Exit_NextRecord_Click:
Exit Sub
Err_NextRecord_Click:
MsgBox Err.Description
Resume Exit_NextRecord_Click
End Sub
I dont know what code to insert for it to stop at the last record which has data in it.
Please help...
Thank you in advance
ruby
I have created a command button using the wizard to go to the next record. It works. But the problem is, if i have 2 records already there, and click on next record, when im on record 2. It goes to a new blank record. I dont want it to do that. I want it to stop at the last record which has data in it, not to go to a new record. I have the VB code for it:
Private Sub NextRecord_Click()
On Error GoTo Err_NextRecord_Click
DoCmd.GoToRecord , , acNext
Exit_NextRecord_Click:
Exit Sub
Err_NextRecord_Click:
MsgBox Err.Description
Resume Exit_NextRecord_Click
End Sub
I dont know what code to insert for it to stop at the last record which has data in it.
Please help...
Thank you in advance
ruby