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

Pause VBA Code while Report Displays

Status
Not open for further replies.

kennedymr2

Programmer
May 23, 2001
594
AU
I have a VBA Routine which does several functions, in a long list of code...
If i need to dispay a form, and hold code execution, i can use the following, it seems to work fine., for a form.

DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog, "Dialog"


BUT.

If i need to Preview a report, and halt code execution, the Print command as below, does not have a "dialog"...
ie,. the Msgbox comes up on top of the Report Preview...

'Now Print a Report....................
stDocName = "InvoicesPaymentsClientsCurrent"
DoCmd.OpenReport stDocName, acPreview

'Mark as billed
result = MsgBox("Mark as Final ", vbOKCancel, "Confirm action")

If result = vbOK Then


Appreciate any ideas, to halt code execution while a report previews.ie i need the client to possible print the report, before the messagebox comes up.

Regards Kennedymr2
 
Have done a bit of fiddling and have worked it out !!!!!

Do While CurrentProject.AllReports!InvoicesPaymentsClientsCurrent.IsLoaded
DoEvents
Loop


Regards Kennedymr2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top