Hello All,
Any ideas on creating a confirmation message box that will confirm with the user if they wish to save a record. And Also, will not save the record if the "X" is clicked. I "borrowed" the following code below, which seems to solve the confirmation end, but the record stills saves if the "X" is clicked, at time saving an incomplete entry. Any help would be appreciated
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
Dim intPress As Integer
DoCmd.SetWarnings False
intPress = MsgBox("Are you sure you wish to save this entry?", vbWarning + vbOKCancel, "warning"
If intPress = vbOK Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmdSave_Click:
End If
DoCmd.SetWarnings True
Exit Sub
Err_cmdChatSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub
Thanks,
MykH
Any ideas on creating a confirmation message box that will confirm with the user if they wish to save a record. And Also, will not save the record if the "X" is clicked. I "borrowed" the following code below, which seems to solve the confirmation end, but the record stills saves if the "X" is clicked, at time saving an incomplete entry. Any help would be appreciated
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
Dim intPress As Integer
DoCmd.SetWarnings False
intPress = MsgBox("Are you sure you wish to save this entry?", vbWarning + vbOKCancel, "warning"
If intPress = vbOK Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Exit_cmdSave_Click:
End If
DoCmd.SetWarnings True
Exit Sub
Err_cmdChatSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub
Thanks,
MykH