G
Guest
I have a command button that runs a query 'on click' and the form allows uses
to select filters by means of check buttons. Everything works fine except
that I would like the query not to run unless a check box is selected. I'm
trying the following VBA which gives the message box but doesn't stop the
query running.
If Check3 = 0 And Check5 = 0 And Check7 = 0 And Check9 = 0 Then
MsgBox "You must select at least one search criteria", vbExclamation
SentMail.SetFocus
Cancel = True
End If
Can anyone help where am I going wrong, thanks in anticipation.
to select filters by means of check buttons. Everything works fine except
that I would like the query not to run unless a check box is selected. I'm
trying the following VBA which gives the message box but doesn't stop the
query running.
If Check3 = 0 And Check5 = 0 And Check7 = 0 And Check9 = 0 Then
MsgBox "You must select at least one search criteria", vbExclamation
SentMail.SetFocus
Cancel = True
End If
Can anyone help where am I going wrong, thanks in anticipation.