Cancel a report.... (1 Viewer)

R

ryker

Guest
I have several reports which get their data from a parameter queries, which in turn uses a forms to gather user input for parameters.

All is well unless the user clicks the cancel button. I have the cancel button set to a macro which closes the form.

The form closes, however the report will prompt for parameter (Forms!CritPro!EndDate)
and force the user to also cancel this operation.

I've tried several different option to get this report to cancel properly, to no avail.

Any suggestions would be greatly appreciated!!
 

llkhoutx

Registered User.
Local time
Today, 14:44
Joined
Feb 26, 2001
Messages
4,018
Modify the code behind the cancel button to close the report as well as the form.
 
R

ryker

Guest
Thanks for the help however I,ve tried that, and still get the same dialogue box to cancel the parameter.
Maybe I'm going about this in the wrong sequenece. The way I have it setup now is to use onopen from the report properties to run a macro which in turn opens a form that the user can choose their parameters from combo boxes. These parameters are then passed to the query. The cancel button on the parameter form is setup to run a cancel macro. I've tried to setup this macro to close the form, query and report.
Any other thoughts would be greatly appreciated!
 

Talismanic

Registered User.
Local time
Today, 20:44
Joined
May 25, 2000
Messages
377
ryker,

I am not sure if this will work in your situation but you can open reports with criteria without using a parenter query. For instance, on one of my forms I have two combo boxes. One shows all the estimators and the other show available sales years. The user can select from each box, hit the Get Report command button and the report will open up with the specified criteria only.

In my code I also have a DCount run before the report is opened that looks for the relevant data, if none is found a message bos is shown to the user and offers them a OK/Cancel to go back to the form.

If this will work in your situation, let me know and I will post the code with some more explanation.
 

Talismanic

Registered User.
Local time
Today, 20:44
Joined
May 25, 2000
Messages
377
You didn't ask but here is the thread that I started when I was trying to get this all figured out. The very last post will show you how to do it with one command.

By the way I only posted the open report code so if you want to see the whole thing I will get it for you.

<A HREF="http://www.access-programmers.co.uk/ubb/Forum7/HTML/001038.html" TARGET=_blank>
Topic: Open report based on multiple criteria</A>


[This message has been edited by Talismanic (edited 03-09-2001).]
 
R

ryker

Guest
Talismanic,
Unfortunately this won't help with this problem, however I think I have another project this will be a great help on.
Thankx,
Ryker
 

Users who are viewing this thread

Top Bottom