colinmunnelly
Registered User.
- Local time
- Today, 00:20
- Joined
- Feb 26, 2002
- Messages
- 89
The code below brings up a "Do you want to save message box" problem is for some reason it saves even if you press No. Can anybody spot the problem?
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim Msg, Style, Response, MyString
Beep
Msg = "Do you wish to save this record?"
Style = vbYesNo + vbExclamation + vbDefaultButton1 'define buttons
Title = "Confirm Save" '
respnse = MsgBox(Msg, Style, Title)
If Response = vbNo Then
Me.Undo
Exit Sub
DoCmd.RunCommand acCmdSaveRecord
End If
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim Msg, Style, Response, MyString
Beep
Msg = "Do you wish to save this record?"
Style = vbYesNo + vbExclamation + vbDefaultButton1 'define buttons
Title = "Confirm Save" '
respnse = MsgBox(Msg, Style, Title)
If Response = vbNo Then
Me.Undo
Exit Sub
DoCmd.RunCommand acCmdSaveRecord
End If
End Sub