Dialogue box from query criteria

XaloRichie

Registered User.
Local time
Tomorrow, 00:52
Joined
Jul 2, 2003
Messages
70
I have a form based on a query with a criteria which pops up a dialog box asking for the parameter for the query.
It works great unless the user clicks the cancel button...Then
The form continues to open but is blank as the query didn't get its criteria, i guess. What can i do to stop the form opening after cancel has been clicked?
 
The Cancel button is on the "default" Dialog box that access puts up when you have a parameter criteria. So it's not like one i have defined! thats my problem im not sure how to deal with it.
If the cancel button is clicked the query gets no data passed but the form still opens with a blank screen.

The form is called from onclick event of a button on another form. .
 
Instead of using the parameter pop-up box, why use a form? Users can then input info into textboxes and press a cmd button to run the query. Behind the 'onclick' event of the cmd button you can check if all of the details have been entered and display a msgbox if they haven't.

Dave
 
Private Sub cboYear_AfterUpdate()
On Error GoTo MYERR

Me.RecordSource = "Select * from AllYears where MyYear=[ENTER YEAR]"
MYERR:
If Err.Number = 2001 Then MsgBox "User Canceled"

End Sub
 

Users who are viewing this thread

Back
Top Bottom