How can i set the default button in a message box with a Yes and No button. It always defaults to Yes but i want it to default to No. I used this code:
Dim msg, Style, Title, Response
msg = "Are you sure you want to exit without saving the changes ?"
Style = vbYesNo + vbCritical
Title = "IMIS"
Response = MsgBox(msg, Style, Title)
'exit without saving if the answer is yes
If Response = vbYes Then
'first undo changes and close
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.Close
End If
Dim msg, Style, Title, Response
msg = "Are you sure you want to exit without saving the changes ?"
Style = vbYesNo + vbCritical
Title = "IMIS"
Response = MsgBox(msg, Style, Title)
'exit without saving if the answer is yes
If Response = vbYes Then
'first undo changes and close
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
DoCmd.Close
End If