If...Then...Else

R

Robert

I am using the following If...Then...Else statement:

If vbYesNo = vbYes Then
Dim stDocName As String
stDocName = "Rental Report"
DoCmd.OpenReport stDocName, acPreview
Else
DoCmd.CancelEvent
End If

I am trying to execute the printing of the report "Rental
Report" when the vbYes button is selected and when the
vbNo button is selected have the MsgBox close. This
procedure will not execute the printing. Your help is
appreciated and I thank you in advance.
 

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

Top