fayez_MrExcel
Active Member
- Joined
- Oct 29, 2005
- Messages
- 435
- Office Version
-
- 365
- Platform
-
- Windows
I created a unbound form that has a combox with a series of id numbers that when a user choose from it the system will take the values from my Empmaster table which is perfectly okay. My problem is my navigation button, i created below syntax but it doent go to the next record, instead it goes to my message "This is the Last Record". What seems to be the problem. How can i set that the Empmaster table is going to be used to navigate. thanks
Private Sub cmdGoNext_Click()
On Error GoTo Err_Go2Next_Click
DoCmd.GoToRecord , , acNext
Exit_Go2Next_Click:
Exit Sub
Err_Go2Next_Click:
If Err.Number = 2105 Then
MsgBox "This is the Last Record"
Else
MsgBox Err.Description
Resume Exit_Go2Next_Click
End If
End Sub
Private Sub cmdGoNext_Click()
On Error GoTo Err_Go2Next_Click
DoCmd.GoToRecord , , acNext
Exit_Go2Next_Click:
Exit Sub
Err_Go2Next_Click:
If Err.Number = 2105 Then
MsgBox "This is the Last Record"
Else
MsgBox Err.Description
Resume Exit_Go2Next_Click
End If
End Sub