S
Scott
Below I have code for 2 buttons, one sub for next record button and one sub
for a previous button. In sub cmdNext_Click() I have code that detects if
the record is new and if it is and user clicks next again, don't display
access's warning.
However, I'm trying to figure out how to do the same for a previous button.
If user is on 1st record in the form and clicks previous button, I'd like to
suppress access's warning message.
Is this possible?
CODE ****************
Private Sub cmdNext_Click()
On Error GoTo Err_cmdNext_Click
If (Not Screen.ActiveForm.NewRecord) Then
DoCmd.GoToRecord , , acNext
Me!userLast.SetFocus
End If
Exit_cmdNext_Click:
Exit Sub
Err_cmdNext_Click:
MsgBox Err.Description
Resume Exit_cmdNext_Click
End Sub
Private Sub cmdPrevious_Click()
DoCmd.GoToRecord , , acPrevious
End Sub
for a previous button. In sub cmdNext_Click() I have code that detects if
the record is new and if it is and user clicks next again, don't display
access's warning.
However, I'm trying to figure out how to do the same for a previous button.
If user is on 1st record in the form and clicks previous button, I'd like to
suppress access's warning message.
Is this possible?
CODE ****************
Private Sub cmdNext_Click()
On Error GoTo Err_cmdNext_Click
If (Not Screen.ActiveForm.NewRecord) Then
DoCmd.GoToRecord , , acNext
Me!userLast.SetFocus
End If
Exit_cmdNext_Click:
Exit Sub
Err_cmdNext_Click:
MsgBox Err.Description
Resume Exit_cmdNext_Click
End Sub
Private Sub cmdPrevious_Click()
DoCmd.GoToRecord , , acPrevious
End Sub