Saving Changes

mlyles

Registered User.
Local time
Today, 03:10
Joined
Nov 28, 2004
Messages
26
I added a control button that when you click it, it mails a form. I also added a popup box that says "Would you like to save your changes before mailing", but when this comes up it has the choices of "Yes" and "Cancel", instead of "Cancel" I would like it to say "No", what should I do. Here is the code from the button. Thank you.


Private Sub mailreport_Click()
On Error GoTo Err_mailreport_Click

Dim stDocName As String

stDocName = "frm-SOW-Summary"
If MsgBox("Would you like to save your changes before mailing?", vbOKCancel) = vbOK Then
DoCmd.Save acForm, "frm-SOW-Summary"
End If

DoCmd.SendObject acForm, stDocName

Exit_mailreport_Click:
Exit Sub

Err_mailreport_Click:
MsgBox Err.Description
Resume Exit_mailreport_Click

End Sub
 
Message

How about this:

Private Sub mailreport_Click()
On Error GoTo Err_mailreport_Click

Dim stDocName As String

stDocName = "frm-SOW-Summary"
If MsgBox("Would you like to save your changes before mailing?", vbYesNo) = vbYes Then
DoCmd.Save acForm, "frm-SOW-Summary"
End If

DoCmd.SendObject acForm, stDocName

Exit_mailreport_Click:
Exit Sub

Err_mailreport_Click:
MsgBox Err.Description
Resume Exit_mailreport_Click

End Sub
 

Users who are viewing this thread

Back
Top Bottom