Hello,
I want to be able to disable some date-checking code while entering a date for a control while the "ALT" key is held down. Normally I would want the user to only be able to input Today's date. A message will pop-up if the date entered is either before or after the current day. I want to use something like KeyCode so that I can bypass the date-checking code and enter any date I wish.
This is kind of what I would like but I need some help with the KeyCode part.
Any help would be appreciated.
Thanks
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++
If (KeyCode = 18) Then ' KeyDown Alt
'Nothing
Else
If (Me.Cut.Value < Date) Then
MsgBox "A past date is not valid. " & vbNewLine & "Please enter today's date."
Cancel = True
ElseIf (Me.Cut.Value > Date) Then
MsgBox "A future date is not valid. " & vbNewLine & "Please enter today's date."
Cancel = True
Else
'Nothing
End If
End If