Forcing Report to Top

  • Thread starter Thread starter Don
  • Start date Start date
D

Don

Hello, I have a Access 97 application. I have a modal popup form that I
preview a report from. The report appears under the popup form. How do I
force the report to always be on top?

Thanks

Don
 
Hello, I have a Access 97 application. I have a modal popup form that I
preview a report from. The report appears under the popup form. How do I
force the report to always be on top?

Thanks

Don

Depends.
If the modal form has been opened by the report,
add a command button to the form.
Code it's click event:
Me.Visible = False

Code the Report's Close event (to make the form visible again):
Forms!FormName.Visible = True

Or to close the form:
DoCmd.Close acForm, "FormName"

If the Modal form is actually opening the report, code the command
button on the form:
DoCmd.OpenReport "ReportName", acViewPreview
Me.Visible = False

Then either make the form visible again or close it in the report
Close event, as above.
 
Another method along the same lines as Fred has posted, is, if your form is
opening the report to use code like the following in the command button that
opens the report:

Docmd.OpenReport "MyReport", acViewPreview
Me.Visible = False
While SysCmd(acSysCmdGetObjectState, acReport, "MyReport") = acObjStateOpen
DoEvents
Wend
Me.Visible = True
 
Back
Top