I have a command button (command187) that opens a form. Before the user can enter the form, a pop-up box is produced that requires a date to be entered. This gets passed to the query & hence opens the form with the required data.
If no date is entered & 'cancel' is selected on the pop-up box, the form still opens.
This is the code on the command button:
On Error GoTo Err_Command187_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAllOrdersEnteredinaDay"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command187_Click:
Exit Sub
Err_Command187_Click:
MsgBox Err.Description
Resume Exit_Command187_Click
Does anyone know how I could stop the form from opening in this instance?
If no date is entered & 'cancel' is selected on the pop-up box, the form still opens.
This is the code on the command button:
On Error GoTo Err_Command187_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAllOrdersEnteredinaDay"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command187_Click:
Exit Sub
Err_Command187_Click:
MsgBox Err.Description
Resume Exit_Command187_Click
Does anyone know how I could stop the form from opening in this instance?