Reports Close Event

Tim L-B

Registered User.
Local time
Today, 19:11
Joined
Mar 21, 2007
Messages
10
Hi All

Hope you can help. I have a report controlled by options on a popup form. The report preview can stay open when the form is closed but I don't want the form to stay open when the report is closed. I put code to check if form is open and then close it in the report's close event.
Strangely the close event on the report seems to get called when the report opens so the popup form closes before it can be of any use. The close event also get called when the report closes as expected so I havent confused open with close.

Any ideas folks :confused:
 
The close event shouldn't/doesn't fire when the report opens. I have used the close event to close forms in similar circumstances many times, and it works fine. Are you sure some other code isn't causing it? Switching to design view will trigger the close event, for instance.
 
Post the code you have on each of the events and/or post the database so we can see it.
 
I really should remember to refresh the thread before I post if I've had it open for a while. I keep posting after someone else has already done so because I forget to refresh to look first. :(
 
Thanks Paul & Bob

Your comments have made me recheck and the reason for the problem now makes sense. The Opps form opens the report when it loads and then confirms no filter and sets the sort order and it is this that closes the report to reopen with the confirmed filter & sort. The options form allows filter and sort changes which again trigger the report close event to reopen with revised order and data. My work around is for the opps form to check that the report is open before any action is taken and close if the report is not found plus the close is also triggered by the timer event if the form is ignored.
Thanks once again for your prompt and helpful advice.
Have a great Christmas and New Year.. :)
 

Users who are viewing this thread

Back
Top Bottom