Hiding a Form when a Report Runs

J

Joe Coulter

Hi

I thought I had posted this before, but it didnt appear, anyway :-

I have a Popup Form "FRM_HEAD" which has a command button "BTN_PRINT" which
runs a report "RPT_WEEK_SUM" in Print Preview, when the report is run, it
appears behing the popup form and cannot be seen, I know if I make the form
not popup it will work ok, but I need the form to be popup. I have tried
hiding the popup form on the open event of the report with the intention of
showing it again when the form closes, but when I tried this, I get a message
saying I cannot hide an object that has the focus.

Does anyone have a solution for this problem, I would greatly appreciate
some help.

I have also played with the idea of displaying the report within another
form, but I cant see how to achieve that either.

Thanks in anticipation


Joe
 
K

Keith Wilby

Joe Coulter said:
Hi

I thought I had posted this before, but it didnt appear, anyway :-

I have a Popup Form "FRM_HEAD" which has a command button "BTN_PRINT"
which
runs a report "RPT_WEEK_SUM" in Print Preview, when the report is run, it
appears behing the popup form and cannot be seen, I know if I make the
form
not popup it will work ok, but I need the form to be popup. I have tried
hiding the popup form on the open event of the report with the intention
of
showing it again when the form closes, but when I tried this, I get a
message
saying I cannot hide an object that has the focus.

Does anyone have a solution for this problem, I would greatly appreciate
some help.

I have also played with the idea of displaying the report within another
form, but I cant see how to achieve that either.

Thanks in anticipation


Joe

Try setting the visible property of the form in the open and close events of
the *report*, it should work that way.

Keith.
www.keithwilby.co.uk
 
M

Mr. B

Place the following code in then OnOpen event of your report:

'make your form not visible
Forms!NameOfYourForm.Visible = False
'optionally make the report fill the screen
DoCmd.Maximize

Then use the following code in the OnClose event of your report:

'make your form to be visible again
Forms!NameOfYourForm.Visible = True
'make your form the size it was before you opened the report to full screen
DoCmd.Restore

--

-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm
 
J

Joe Coulter

Hi Mr.B

Thanks for your reply, I have already tried that and it dosnt work, what
happens is that it does hide the popup form, but the report also disappears,
I think I have left out another piece of vital info that affects the report:-

When the popup form opens, it hides the application so the user only sees
the form itself. I think I need to unhide the application when the popup
form is hidden.

sorry for being a pain, I will try that and let you know.

Jo
 
J

Joe Coulter

Got it, Mr. b, Using what you suggested and adding a show application when
report runs worked a treat, thanks for your assistance.

Joe
 
K

Keith Wilby

Joe Coulter said:
Got it, Mr. b, Using what you suggested and adding a show application
when
report runs worked a treat, thanks for your assistance.

Joe

You're making life difficult for yourself :)

Instead of hiding the application, set the start-up options such that the
database window is hidden.

Keith.
www.keithwilby.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top