I have a form with the Pop Up property set to ‘Yes’. There is a button on my form that when clicked provides a Print Preview of the data on the form. However when the ‘Preview’ button is clicked, the form stays in front and hides the preview. Is there any way to either get the form to minimise or go behind the Print preview. The code on the preview button is DoCmd.OpenReport ““PurchaseOrders””, acViewPreview, “”“”, “”“”“”[PurchaseOrderNo]=“”“” & [Forms]![PurchaseOrders]![PurchaseOrderNo]“”, acNormal What extra code can I put in to get the form out of the way? Cheers, David

Thanks for your help. Such a simple solution, but does the job perfectly.

Just to clarify,
If you set your form to “Modal” it will stay in focus (On Top) and not allow other forms to obtain focus. You have to explicitly close the form to proceed with the app. (Ex: A message box typically behaves in Modal fashion whereby you have to press the ok button to proceed)

A Pop-Up is a "style’ of window / form presentation. In Access, the default style of presentation is typically MDI (Multiple Document Interface) ; meaning they are tied in to a containing window. Pop-up mode allows a form to display independant of the MDI container. (But, To make it stay on top, it has to be set to modal). If you have two or more pop-ups, you can swap their ZOrder with the mouse. (but You can’t do that if one of them is set to Modal).

'On the OnOpen of the report make the popup form invisible:

Forms![popupformname].Visible = false
'Then on the OnClose of the report
Forms![popupformname].visible = true

From: grant-collinsworth via access-l [mailto:access-l@Groups.ITtoolbox.com]
Sent: Friday, April 30, 2010 7:55 AM
To: randy_caus
Subject: RE:[access-l] “Pop-up” form hides the Print Preview screen

Posted by grant-collinsworth
on Apr 30 at 10:54 AM Mark as helpful

David,

Try this command in the button event that launches your print dialog:

DoCmd.Minimize

EXAMPLE:
Private Sub ShowMyPrintDialog_Click()
’ open the print dialog, then…
DoCmd.Minimize
End Sub

This will Minimize the window for you and leave only the the Print Dialog up front. Its not as fun as using the windows “ZOrder” method, but unfortunately, VBA does not support that method

Hope this helps

Grant

David,

Try this command in the button event that launches your print dialog:

DoCmd.Minimize

EXAMPLE:
Private Sub ShowMyPrintDialog_Click()
’ open the print dialog, then…
DoCmd.Minimize
End Sub

This will Minimize the window for you and leave only the the Print Dialog up front. Its not as fun as using the windows “ZOrder” method, but unfortunately, VBA does not support that method

Hope this helps

Grant