Dialogue box from query criteria (1 Viewer)

XaloRichie

Registered User.
Local time
Today, 13:34
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?
 

AncientOne

Senior Citizen
Local time
Today, 12:34
Joined
Mar 11, 2003
Messages
464
where is the cancel button? What code is attached to it?
 

XaloRichie

Registered User.
Local time
Today, 13:34
Joined
Jul 2, 2003
Messages
70
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. .
 

daveUK

Registered User.
Local time
Today, 12:34
Joined
Jan 2, 2002
Messages
234
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
 

IgorB

Registered User.
Local time
Today, 12:34
Joined
Jun 4, 2003
Messages
183
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

Top Bottom