Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unloading a form from a newbie

Status
Not open for further replies.

gw73

MIS
Dec 30, 2001
16
US
Hi
I've created a form with an unbound combo box to select a criterion for a query that is used in a report. I also put a command button on the form to open the report in the click event. Everything works fine except I want to unload the form after clicking on the run report button so the user doesn't have to close it. To work around this I set the visible property to false after the click event, but I would rather unload the form. Any suggestions?

Thanks
GW73
 
One possibility is to have the report's Close event close the form, using DoCmd.Close acForm, "form name". Rick Sprague
 
Thanks for replying, but I can't get to work, all I get is a Requires an object name argument message box, I'm still pretty new at this and I assumed this would be the name of the form, if you have an ideas I'm open for suggestions.

Thanks
GW73
 
Are you using a macro in the report's Close event? Then set the Action to Close, set the Object Type to Form, and select your form name from the Object Name box.

Are you using VBA code? Then use the statement I gave you above, substituting your form's name for form name.

If you've done this, and you're still having a problem, I can't see why. Maybe you could paste in the code you're using. Rick Sprague
 
I finally figured it out, I have a funny name for the form and it had a typo. Thanks for the help. That solved my problem.

GW73
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top