Reopening a form that called a print preview (1 Viewer)

OBBurton

Registered User.
Local time
Today, 00:24
Joined
Dec 26, 2013
Messages
77
Hi,
Is there any way to open a report in print preview and have the form that opened it be reopened? I've puzzled over this for hours with no success. I can open the report in print preview with no problem, but none of the report events seems to fire when the print or close options are clicked from the print preview. Is there any way back to the form that called the report?

The code I use to call the report is:

DoCmd.Save acForm, "frmInvoice"
Me.Visible = False
DoCmd.OpenReport "rptInvoice", acViewPreview
DoCmd.RunCommand acCmdPrintPreview:

I tried adding DoCmd.OpenForm "frmInvoice" but the print preview closed as soon as it opened.

You can call me "Stumped Again"
If anyone can help me, I'd really appreciate it.
 

OBBurton

Registered User.
Local time
Today, 00:24
Joined
Dec 26, 2013
Messages
77
Thanks for responding! I really appreciate it!
Unfortunately, I can just barely follow what you are doing. But I must confess that I'm not experienced enough to fill in the blank spots just out of view in the video. I'm hesitant to ask, but would there be any chance I could get a copy of your code? I'm pretty confident that if I had your code I could adapt it to my database, but I just don't think I can fill in the blanks myself.:D
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 08:24
Joined
Sep 12, 2006
Messages
15,710
just do me.visible = true

in fact, why hide the form anyway?
 

OBBurton

Registered User.
Local time
Today, 00:24
Joined
Dec 26, 2013
Messages
77
Hi,
Thanks for responding!
I did not originally have the "Me.Visible = False". I inserted it because the "rptInvoice" preview would flash on the screen, but be immediately covered again by "frmInvoice". After I inserted it, I tried to add either "Me.Visible = True" or "DoCmd.OpenForm "frmInvoice"" after the preview. With these, the code either did not execute at all or executed immediately bringing me back to square one again. Am I doing something wrong either here or elsewhere to get these results?
 
Last edited:

OBBurton

Registered User.
Local time
Today, 00:24
Joined
Dec 26, 2013
Messages
77
Many thanks AccessBlaster!
That did it exactly as I originally intended to do it. I appreciate your help!
 

Users who are viewing this thread

Top Bottom