How do I open a report using a command button on a form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I click on a command form which has a macro assigned that has the
instructions 'Open Report' the report appears ok but the form remains on top
of the report. This does not happen when I am in design view and go to form
view. It only happens when I exit the database and re-enter the database.
Please help.
 
You can change the Macro that run the report to code view, and then add the
code to hide the form while the report is open

Code the command button
DoCmd.OpenReport "ReportName", acViewPreview
Me.Visible = False

Then add the code to the report's Close event:
forms!FormName.Visible = True
 

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

Back
Top