My form has a save cmd button with the following code:
I also intrduced a yesNoCancel msg box with the code:
When the user clicks the save button and hits yes on prompt the yes msj si prompted twice. Why?
Code:
Private Sub Save_Customer_Button_Click()
On Error GoTo Err_Save_Customer_Button_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
[Stop time] = Time
[TotalTime] = Diff2Dates("hns", [Start time], [Stop time], 0)
DoCmd.GoToRecord , , acNext
Exit_Save_Customer_Button_Click:
Exit Sub
Err_Save_Customer_Button_Click:
MsgBox Err.Description
Resume Exit_Save_Customer_Button_Click
End Sub
I also intrduced a yesNoCancel msg box with the code:
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Select Case MsgBox("Salvati Inregistrarea?", vbYesNoCancel, "Atentie!!")
Case vbYes
'code
Save = True
[Stop time] = Time
[TotalTime] = Diff2Dates("hns", [Start time], [Stop time], 0)
Case vbNo
'code
Me.Undo
Case vbCancel
'code
Cancel = True
End Select
End Sub
When the user clicks the save button and hits yes on prompt the yes msj si prompted twice. Why?