Solved

Open a Report with Form Open Event and Display in front of the Form???

Posted on 2011-09-09
11
333 Views
Last Modified: 2012-08-13
I have a main form that opens with the application.  I have added a "Alerts" report for certain information that will be displayed each time the user logs in thus loading Form1.  Form1's Open Even will open the Alerts report in preview mode.  The problem is the report opens behind Form1 making it useless right now.  

I've tried DoCmd.SelectObject acReport, "Report", False  after the DoCmd.OpenReport code to no avail.  Form1 is not Modal nor is it set to remain on top of all other forms.

Any ideas will be appreciated.

Thanks,

ET
0
Comment
Question by:Eric Sherman
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 33

Expert Comment

by:Norie
ID: 36514269
Are you closing the form as well as opening the report?
0
 
LVL 19

Author Comment

by:Eric Sherman
ID: 36514279
No, Form1 is the main form that controls the application.  The "Alerts" report should display (Preview Mode) after the user has logged in, From1 loaded.  The user can review it or print it then close it down.  It works, it just opens each time behind Form1.  I'm sure there's some way to make the report display on top of the form .... not behind it.

ET
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 36514396


open the report in dialog mode

DoCmd.OpenReport "reportName", acViewPreview,,,acDialog
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 250 total points
ID: 36514408
You can cheat by setting the *Report's* Popup property to: Yes

0
 
LVL 19

Author Comment

by:Eric Sherman
ID: 36514431
I ran across those recommendations earlier but in Access 2k ... the acDialog and the Popup Property is not available.  

I can use the DoCmd.Minimize in Open Event on Form1 and now I'm trying to Restore Form1 using the OnClose Event of the Report to no avail.

Forms!Form1.Restore or Forms!Form1.Maximize doesn't seem to work.

Any ideas ...

ET
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36514464
Did you try the code I posted?
0
 
LVL 19

Author Comment

by:Eric Sherman
ID: 36514504
Thanks all for the Replies and I'm sure the two solutions will work in later versions of Access just not 2000.  I will use them there.  

Here's what worked Access 2k.

In From1 Open Event before the report opens ...

DoCmd.Minimize
DoCmd.OpenReport "Report1", acViewPreview


In Report1 OnClose Event .....

If CurrentProject.AllForms("Form1").IsLoaded = True Then
    DoCmd.SelectObject acForm, "Form1"
    DoCmd.Restore
End If


I like the two solutions provided by capricorn1 and boag2000 simply because it's less code and will use them later on but the method above works with Access 2k.

Thanks,

ET Sherman
0
 
LVL 19

Author Comment

by:Eric Sherman
ID: 36514510
<<<<<Did you try the code I posted?>>>>>

Yes, I got a VB Error and on the Report Properties ... there's not PopUp Setting available.  I assume you are using a later version than 2000.

ET Sherman
0
 
LVL 19

Author Comment

by:Eric Sherman
ID: 36514540
Capricorn1 ... Below is the error I receive while running the code you posted.

ET
VBError.png
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36514678
LOL

Yeah, I presumed Acc 03 or higher...

I have seen this, but I don't know if it is applicable (or practical)
http://support.microsoft.com/kb/209938
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36514695
....is it possible to just change the location of the code that opens the report?

ex. something like this:
 
If Report Needs to Show
    OpenForm
    OpenReport
Else
    OpenForm
end if
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

776 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