Bring Report Window to Front

B

Barry Skidmore

Because of the way in which I am opening a report, it is displayed
behind a form window. Using Visual Basic or a macro, how can I bring
this report window "to the front", based on its name?

Thanks,
Barry
 
A

Allen Browne

You can give focus to a report with:
DoCmd.SelectObject acReport, "Report1"

If your form is a popup, it may still float over the report.

If the form is opened in dialog mode, it will also remain in front of the
report unless you set its Visible property to No, or open the report in
dialog mode also (available in Access 2002 / 2003 only).
 
T

TomS - MDC

I'm having a similar issue. But when I run "DoCmd.SelectObject acReport,
<myreportname>" I get a runtime error 2530 that says "The SelectObject method
can't be used on a report that is currently printing." I tried this line of
code in both the Open & Activate events for the report. What I'm trying to
do is to have the report get the focus so I can run "DoCmd.Restore" to
un-maximize the report. Neither Restore or MoveSize will work w/o the
SelectObject first, but I cant get SelectObject to work. Where do I put this
code?
 
Top