I have a field that contains an input mask for a short date which seems to work fine when first entering the date. The problem is when a user goes back to edit the field and tries to edit a single digit. For example, there is a date of 9/09/02 and the user wants to change the date to 9/16/02. If the user deletes just the 09 and enters a 16, an error message pops up stating the value isn't appropriate for the mask. Is there a way to code around this? I tried using the code below on the before update event but it doesn't work.
Dim strEnteredValue As Variant
strEnteredValue = txtDateofService.Value
If IsNumeric(strEnteredValue) = True Then
Me.txtDateofService.Value = Format(strEnteredValue, "Short Date")
End If
Dim strEnteredValue As Variant
strEnteredValue = txtDateofService.Value
If IsNumeric(strEnteredValue) = True Then
Me.txtDateofService.Value = Format(strEnteredValue, "Short Date")
End If