MarcusAntonius
Registered User.
- Local time
- Today, 08:41
- Joined
- Jul 13, 2004
- Messages
- 37
I currently have a textbox on a form where on mousedown it launches a calendar and on click it allows me to select a date. It has a validation rule that controls what date can be selected.
However, if I go to a record that has a date entered in the textbox and try to delete the value then the validation rule kicks in. How do I modify it so it will allow me to enter a blank value?
Private Sub Calendar1_Click()
If Calendar1.Value >= (MDate1 - 7) Then
MsgBox "Cancellation must be at least seven days in advance of the first meeting.", vbOKOnly, "Cancellation Date"
Else
CDate1.Value = Calendar1.Value
CDate1.SetFocus
Calendar1.Visible = False
End If
End Sub
Private Sub CDate1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Calendar1.Visible = True
Calendar1.SetFocus
If Not IsNull(CDate1) Then
Calendar1.Value = CDate1.Value
Else
Calendar1.Value = Date
End If
End Sub
However, if I go to a record that has a date entered in the textbox and try to delete the value then the validation rule kicks in. How do I modify it so it will allow me to enter a blank value?
Private Sub Calendar1_Click()
If Calendar1.Value >= (MDate1 - 7) Then
MsgBox "Cancellation must be at least seven days in advance of the first meeting.", vbOKOnly, "Cancellation Date"
Else
CDate1.Value = Calendar1.Value
CDate1.SetFocus
Calendar1.Visible = False
End If
End Sub
Private Sub CDate1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Calendar1.Visible = True
Calendar1.SetFocus
If Not IsNull(CDate1) Then
Calendar1.Value = CDate1.Value
Else
Calendar1.Value = Date
End If
End Sub