T
TomP
I want to pass my many thanks to your team for all your inputs! You've been
great!! THANK YOU!!
Question: When I insert a command button on the form, I notice that the
Error event does not recognize my instruction to modify a default error
message. On the other hand, I do get the modified message when I click on
the navigation bar on the form to add a new record. Again, my command button
does not recognize the code. See below
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 3314 Then
MsgBox "Please ensure that you enter a caseload type before you
continue!", vbCritical, "Caseload Type Error Message"
Response = acDataErrContinue
Else
Response = acDataErrDisplay
End If
End Sub
Here is the command button code
Private Sub Command259_Click()
On Error GoTo Err_Command259_Click
DoCmd.GoToRecord , , acNewRec
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FormSeeker"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command259_Click:
Exit Sub
Err_Command259_Click:
MsgBox Err.Description
Resume Exit_Command259_Click
End Sub
NOTE: I haven't entered any codes to modify the command button, because I
couldn't make it work. The command button works fine, but what happens is
when I get a default error message "You can't go to the specified record" ,
I click OK and move on. It would be nice if I could modify it to be more
specific. PLEASE don't tell me that it is Error 2105. I've been in an
endless loop trying to make it work. I've tried it and still can't change
that message.
Thank you again for your help!
great!! THANK YOU!!
Question: When I insert a command button on the form, I notice that the
Error event does not recognize my instruction to modify a default error
message. On the other hand, I do get the modified message when I click on
the navigation bar on the form to add a new record. Again, my command button
does not recognize the code. See below
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 3314 Then
MsgBox "Please ensure that you enter a caseload type before you
continue!", vbCritical, "Caseload Type Error Message"
Response = acDataErrContinue
Else
Response = acDataErrDisplay
End If
End Sub
Here is the command button code
Private Sub Command259_Click()
On Error GoTo Err_Command259_Click
DoCmd.GoToRecord , , acNewRec
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FormSeeker"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command259_Click:
Exit Sub
Err_Command259_Click:
MsgBox Err.Description
Resume Exit_Command259_Click
End Sub
NOTE: I haven't entered any codes to modify the command button, because I
couldn't make it work. The command button works fine, but what happens is
when I get a default error message "You can't go to the specified record" ,
I click OK and move on. It would be nice if I could modify it to be more
specific. PLEASE don't tell me that it is Error 2105. I've been in an
endless loop trying to make it work. I've tried it and still can't change
that message.
Thank you again for your help!