InputBox (1 Viewer)

BoroLee

Registered User.
Local time
Today, 17:20
Joined
Aug 30, 2000
Messages
90
I have the following code attached to a button

BudHdr = InputBox("You may also send a complete set of these reports. To do so, please type the name of the recipient(s) in the box below. Please use an ; to identify different recipients.", "E-mail ALL ?")
DoCmd.SendObject acSendReport, , "SnapShot Format(*.snp)", BudHdr, , , "Budget Monitoring Reports", "Please find enclosed a complete set of Budget Monitoring Reports for your area.", False

If i don't want to send these reports, I thought clicking on the Cancel button would stop the code running. However I still get the Outlook message to send.

Ideas ????????
 

kirbott

Registered User.
Local time
Today, 17:20
Joined
Feb 15, 2000
Messages
12
The InputBox function returns and empty string ("") if Cancel is selected. Simply place an If statement before your DoCmd.SendObject line:

If BudHdr <> "" Then
DoCmd.SendObject......
End if

Hope this helps.
 

Users who are viewing this thread

Top Bottom