Hide form

B

Bill H.

I have a form with a command button that runs a report.

I want to hide the form when the report button is clicked (easy) and then
for the form to stay hidden until the report is closed (not as easy).

How can I make that happen?

Thanks.
 
G

Guest

One way I was able to do this was to set the visibility of the form = false.
Here is the code snippet:

Me.Form.Visible = False
DoCmd.OpenReport "MyReport", acViewPreview, , , acDialog
Me.Form.Visible = True

The report form needs to be dialog to pause the code execution until the
report is closed. Otherwise the code to hide the form will immediately
display it again as soon as the report is loaded. Hope that helps and I am
sure there are many other ways to do this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top