K
KC
I have several forms built on queries, after clicking the
button to open the form the parameter box comes up, if the
user enters a parameter and clicks okay everything works
just fine, but if the user clicks cancel the the form does
not open and the form the orginal button was on closes,
this is a problem especially since the database is locked
so this effectively closes the program completely. I have
put the following code and several veriations of it in the
code builder, but nothing has worked yet, can anyone help?
On Error GoTo Err_Handler
DoCmd.OpenQuery "Query Name"
Exit_This_Sub:
Exit Sub
Err_Handler:
If Err = 2501 Then
Else
MsgBox "Error # " & Err.Number & " " & Err.Description
End If
Resume Exit_This_Sub
button to open the form the parameter box comes up, if the
user enters a parameter and clicks okay everything works
just fine, but if the user clicks cancel the the form does
not open and the form the orginal button was on closes,
this is a problem especially since the database is locked
so this effectively closes the program completely. I have
put the following code and several veriations of it in the
code builder, but nothing has worked yet, can anyone help?
On Error GoTo Err_Handler
DoCmd.OpenQuery "Query Name"
Exit_This_Sub:
Exit Sub
Err_Handler:
If Err = 2501 Then
Else
MsgBox "Error # " & Err.Number & " " & Err.Description
End If
Resume Exit_This_Sub