Cancelled but Query still runs

Sherri1509

New member
Local time
Today, 12:34
Joined
Jan 24, 2002
Messages
7
I have some reports that uses an unbounded form to enter filter criteria for beginning and ending date on the report. The form has a CANCEL and an OK botton. The OK button works fine. However when the cancelled botton is click the query stills runs requesting the paramaters. The onclick on the CANCEL button calls this function.

Private Sub FormCancel_Click()
DoCmd.Close acForm, Me.Name
End Sub

How can I get this query from still running?


Macros are created for the form.

It has a CancelEvent macro that is suppose to cancel printing or previewing of the report. The macro has condition:

Not FunctionName("FormName")

There is also a macro for the Cancel Button. Its action is set to close
The cancel button has onclick properties set to Formname.Cancel

I followed the instruction in MS Access Help. This can be found by entering criteria"form to enter report criteria"



[This message has been edited by Sherri1509 (edited 01-24-2002).]
 
What happens before you get to this form?

Have you checked the names of the command buttons to be sure that they are different from each other?
 
The form has some macros behind it. One to open,close,cancel, OK, and cancel event
 
I don't know if you are still checking the post re: Qry still runs after cancelling event/closing form posted by qckslvr1999, but I have figured out a relatively easy way to get the second, default, parameter prompt to not appear after cancelling a custom dialog parameter form. It's nothing fancy, but it does work. Here's the URL of the page where the post should be. Hope it helps, if you still need it.
http://www.access-programmers.co.uk/ubb/Forum3/HTML/002838.html

good luck
Fawn
 
Thanks. It worked perfectly if not run from a switch board. However my message when run from a switch board is "There was an Error executing the command"
 
Not sure why the error, but it may just be an issue of needing to recreate the command button that is used inthe switchboard to run the report.
 

Users who are viewing this thread

Back
Top Bottom