PDF Issues

anissw

Registered User.
Local time
Today, 08:59
Joined
Jun 11, 2012
Messages
55
Hello- I'm trying to open a report from a button on a form in preview mode. When the report opens, the option to close print preview, pdf or xps, etc on the top nativiation pane is locked not allowing me to export to a PDF, change orientation, or print. I have to go to Window and then select it to bring focus to the options. Here's my code I am using:

DoCmd.SetWarnings False
DoCmd.OpenQuery "UpdateMasterInvoice", acViewNormal, acEdit
DoCmd.Close acQuery, "UpdateMasterInvoice"
DoCmd.OpenReport "Invoice", acViewPreview, , strWhere, acWindowNormal, strOpenArgs
DoCmd.Close acMacro, "InvoiceExport"


Any suggestions?

Thanks:


Anissa :banghead:
 
Try adding this to the end of your code:

Reports!Invoice.Focus
 
Hi Thanks for replying. Do I add at the end of closing my macro or where the report preview begins?
 
You want to set focus to it after the report opens.
Code:
DoCmd.SetWarnings False
[SIZE=3][FONT=Times New Roman]DoCmd.OpenQuery "UpdateMasterInvoice", acViewNormal, acEdit[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]DoCmd.Close acQuery, "UpdateMasterInvoice"[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]DoCmd.OpenReport "Invoice", acViewPreview, , strWhere, acWindowNormal, strOpenArgs[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman]DoCmd.Close acMacro, "InvoiceExport"[/FONT][/SIZE]
Reports!Invoice.Focus
 
Thanks so much. I was able to get it to work.:D
 

Users who are viewing this thread

Back
Top Bottom