Button to open report and close form

dataheadache

Registered User.
Local time
Today, 22:05
Joined
Feb 18, 2004
Messages
28
I've built a form which asks for data to search my database, once I select the data - I click the Preview button which sends the requested data to the query to bring up the report - on my form I have two button "Preview" and "Cancel" - I want to enhance the Preview button to close the form which requested the data automatically after it has loaded the report - how do I do this?

Any help gratefully received.
 
Rich said:
DoCmd.Close ?

OR as Mile's taught me.... :D

Code:
DoCmd.Close acForm, Me.Name
OR
Code:
DoCmd.Close acForm, "frmName"
________
White widow seeds
 
Last edited:
a.sinatra said:
OR as Mile's taught me.... :D

Code:
DoCmd.Close acForm, Me.Name
OR
Code:
DoCmd.Close acForm, "frmName"

Yes, I do believe that's now required in the newer versions :rolleyes:
 
Rich said:
Yes, I do believe that's now required in the newer versions :rolleyes:

Thanks a.sinatra - that worked a treat - the problem with DoCmd.Close, rich is that after the report was opened, the report became the active window and if I just put DoCmd.close it would have closed the newly created report, and not the form - which is not what I wanted!!
 

Users who are viewing this thread

Back
Top Bottom