Coding Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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.
 
Why not use a Toolbar with a Print Button tied to the report to avoid
regenerating the report?

Pieter
 
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/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top