A
Al
A quick and dirty way to achieve this is to replace the
message box that would normally come up in the code. For
example, I had a previous record button on a form that
would give a default message when the user tried to go
back past the first record. Below is the code with the
default message commented out and my custom message to
replace it:
Private Sub Prev_Click()
On Error GoTo Err_Prev_Click
DoCmd.GoToRecord , , acPrevious
Exit_Prev_Click:
Exit Sub
Err_Prev_Click:
MsgBox ("You are at the first record")
'MsgBox Err.Description -- COMMENTED OUT LINE
Resume Exit_Prev_Click
End Sub
HTH,
Al
message box that would normally come up in the code. For
example, I had a previous record button on a form that
would give a default message when the user tried to go
back past the first record. Below is the code with the
default message commented out and my custom message to
replace it:
Private Sub Prev_Click()
On Error GoTo Err_Prev_Click
DoCmd.GoToRecord , , acPrevious
Exit_Prev_Click:
Exit Sub
Err_Prev_Click:
MsgBox ("You are at the first record")
'MsgBox Err.Description -- COMMENTED OUT LINE
Resume Exit_Prev_Click
End Sub
HTH,
Al