Solved

Why report preview appearing behind an open form?

Posted on 2014-02-06
4
3,326 Views
Last Modified: 2014-02-07
I have a report preview that when opens appears BEHIND an open form.  If I click on the report it comes to the front.  Why would this be happening and can I make it open in front of the open form?
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 15

Expert Comment

by:gplana
ID: 39840491
Check the popup property on your form. If it is set, then the form will be above. You should set it to false (and also the modal property too).

Hope it helps.
0
 

Author Comment

by:SteveL13
ID: 39840545
Both popup and modal are false.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39840724
change the code that open the report, with the option acdialog

like this

DoCmd.OpenReport "ReportName", acViewPreview, Windowmode:=acDialog
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39841465
<< I have a report preview that when opens appears BEHIND an open form. >>
<< Both popup and modal are false. >>

Opening a report from a form will by default make the report appear on top of the form as you are looking for.  (The report shown on top is *normal* behavior)

<< Why would this be happening >>

There are a couple of factors that might cause the form to show up on top instead of the report.
1.  The form will display on top if it's popup property is true or if it was opened with acDialog window mode.

2. If the code executing in your form refers back to the form or a control on the form after your OpenReport command, it will bring the form back into focus and make the form appear on top of the report.

Based on the code in your recent questions, factor #2 is at work (see the inline comment):

Case 3        
DoCmd.OpenReport "rptOpenReturns", acViewPreview
Reports!rptOpenReturns.lblAllRMAStatus.Visible = True
Me.Frame21 = Null '******** This will bring the form to the top ******

Open in new window


Opening the report with acDialog, as cap1 mentioned will force the report to the top.  However, it will also suspend the code execution until the report closes, which will cause the second line of code to error after the report is closed.

So your options are to use acDialog and move the second line of code to your report's Detail Format event, OR  rewrite the code that opens your report so that the form reference comes before the OpenReport command, like this:

Case 3       
Me.Frame21 = Null
DoCmd.OpenReport "rptOpenReturns", acViewPreview
Reports!rptOpenReturns.lblAllRMAStatus.Visible = True

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question