- Browse code for:
- Browser
- Data
- Server
- Mobile
- Multimedia
- Platform
Override Date Confirmation
Private Sub cmdTodayDate_Click()
On Error GoTo Err_Handler
Dim strAnswer As String
Dim temp As Date
If Nz(Me.DateControl) "" Then
strAnswer = MsgBox("Do you want to overwrite the existing date?", _
vbYesNo, "Date Exists")
If strAnswer = vbNo Then
Exit Sub
End If
End If
Me.DateControl = Format(Now(), "short date")
Exit_Handler:
Exit Sub
Err_Handler:
MsgBox "An error has occurred." & vbCrLf & _
"Error Number: " & Err.Number & vbCrLf & _
"Error Description: " & Err.Description, _
vbCritical, "cmdTodayDate_click"
Resume Exit_Handler
End Sub