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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nonblocking vba call?

Status
Not open for further replies.

evilmousse

Programmer
Apr 15, 2003
85
US


I'm attempting to have a yes/no messagebox appear after someone closes a report that asks if they wish to print the report to PDF. To print the just-displayed report, it needs to be closed, then opened in print mode. I put the messagebox in the onclose event of the report, and it calls a vba function in it's corresponding dialog form to then reopen in print mode and all the other tasks that get it to print to PDF. Problem is, the report blocks and waits on the call to the dialog form's function, and doesn't exit until it returns. Therefore I can't open it in print mode because it's still open in display mode. If only the call wouldn't block, the report would then close, and I'd be free to print it.
Anyone have any advice on how I should accomplish this?

-g
 
why open the form as acDialog? In this situation, that's causing the problem. Just create a Form open with 2 command buttons Yes and No and make it large enough that the user has to close it to get back to anything else. Only allow them to close it by clicking the Yes command button or the No command button by setting the Control Box, and Close Button Properties to No, and Min Max Buttons to None.

PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top