Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing A Report Opened Via Pop Up Form

Status
Not open for further replies.

nyamrembo

Technical User
Apr 15, 2010
52
US
Hi,
I have created a form with date fields to filter several reports. The form properties have Pop Up set to yes and Modal set to yes. Everything is beautiful except when I run the report, the report opens behind the report form so I am forced to close the form before I can view the report. Is there a way around this without having to change the form properties?

Thanks once again,
[sunshine]
 
I got the solution here on Tek-tips. The solution is to set the report properties to pop up as well. So far, it's working great. Thank you guys...you are all really wonderful.

Cheers!
[sunshine]


mondoray (TechnicalUser)
30 Oct 03 17:42
roaml,

Access XP (2002) allows you to set reports to pop up. I have done it in some of my applications and it works fine. All other versions of Access do not offer this facility for reports.
 
You may try to control the form visibility from the report.
The following will hide/show the form from which the report was invoked, regardless of its name or other properties:

Code:
Option Explicit
Dim frmCallingForm as Form

Sub Report_Open(Cancel As Integer)
On Error Resume Next
Set frmCallingForm = Screen.ActiveForm
frmCallingForm.Visible = False
End sub

Sub Report_Close()
On Error Resume Next
frmCallingForm.Visible = True
End Sub



[pipe]
Daniel Vlas
Systems Consultant

 
Hi Daniel,
I tried the above code and placed it on the report form but it did not respond. Am I doing something wrong? I replaced the name of my report filter form with frmCallingForm. And I have a form with radio buttons and a command button that opens the reports when a radio button is selected. My first choice of setting the report properties to pop up did not work because it does not allow me to print the report. Pretty much the report behaves the same way as the report form which is also a pop up form.

Thanks for your help.

[Sunshine]
 
You shouldn't replace anything.

Copy the code.
Open the report in design view.
Go to View-Code
Paste the code
Save the report.

Open it from your form. The form should disappear before the report is displayed. It should re-appear on screen when you close the report.

Just tested it, with a modal form opening a report.

[pipe]
Daniel Vlas
Systems Consultant

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top