Coding Help

T

trainsteve

I want a command button on a form to do the following:

Prompt User with "Preview Report?"

If yes, then Open "Report1"

When closing the report I want:
Prompt User "Output Report?"
If yes, then Output "Report1"
Else, return to form

Else, Output "Report1"

How do I do this?
 
M

mray29

Try this for the command button:
If Msgbox ("Preview Report?", vbYesNo) = vbYes then
Docmd.Openreport "Report1", acpreview
End if

In the Close event for your report, use the same technique.
 
P

Pieter Wijnen

Why not use a Toolbar with a Print Button tied to the report to avoid
regenerating the report?

Pieter
 
T

Tony Toews [MVP]

trainsteve said:
I want a command button on a form to do the following:

Prompt User with "Preview Report?"

If yes, then Open "Report1"

I always setup two command buttons. One to Preview and the other to
print.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Top