Message Box

jojo

Registered User.
Local time
Today, 04:48
Joined
Jul 20, 2012
Messages
51
I am an Access newbie. I have a form with a command button that displays a report in print preview and a message box that asks the user if he wants to print now. If he clicks vbOK, the printdialog box displays, but if he cancels out of that, he should be able to preview the form to see if he should indeed print, but it reopens the form too quick. How can I control what happens after he aswers the message box?
Access 2010
Thank you so much in advance.
 
You could use some code along the lines of;
Code:
Dim Response

Response = MsgBox("Do you wish to print this report", vbYesNo, "Yes or No")

If Response = vbYes Then
     [COLOR="SeaGreen"]'Put your Print report code here[/COLOR]
Else
     [COLOR="SeaGreen"]'Put code to view report here[/COLOR]
End If
 
thank you so much to Big John Booty super Moderator, for your timely and exelllent answer to my rather dumb question, and for supplying an actual block of code. So helpful! However, I wasn't clear about my prob. I have a form with a print command btn. If clicked, the form closes, the report opens, and a msg box comes up asking if user is reallly ready to print as opposed to previewing the report. user will click no if he wants to preview, but the msg box has to be closed first in order to scroll. If he sees the report is OK and now wnats to print, it would have to be done "manually" by right clicking the report, which shuold realy be disabled. Is there any way to have"press any key to continue," or maybe to only minimize the form, after it's opened in full screen. If he sees an error on report, he'll go back to form to fix, then click print btn again to print. That part is fine. if he needs to preveiw report, or maybe go back to form to fix data, is there a way to maximize the form? I should add that the user is fine as it now stands, I'm just a little compulsive.
I apologize for not getting back sooner, as I was on another project.
Thank you again, and to this whole forum of Access pros for sharing your expertise with us newbies. I read old threads, and learn something new all the time.
 

Users who are viewing this thread

Back
Top Bottom