Code:
Private Sub txt_start_BeforeUpdate(Cancel As Integer)
Dim strtext As String
strtext = Me.txt_start.Value & " "
If Len(strtext) = 1 Then
Me.txt_start.Value = "01/01/2006"
End If
End Sub
I have a scenario where a user erases the prepopulated date of today (using a format on Date). The form is unbound so not hooked to a table definition so I do not believe zero length strings are involved. The field once populated will go into SQL to do a Select query.
The problem is I cannot place the date text into a null value because I keep getting a 2115 runtime error. I think it may be theoretically impossible but I have not given up yet.
I have gone through the archives and found 13 hits. One person had the same issue but the thread was never answered.
Any help would be appreciated.
Thanks,
EP1
Private Sub txt_start_BeforeUpdate(Cancel As Integer)
Dim strtext As String
strtext = Me.txt_start.Value & " "
If Len(strtext) = 1 Then
Me.txt_start.Value = "01/01/2006"
End If
End Sub
I have a scenario where a user erases the prepopulated date of today (using a format on Date). The form is unbound so not hooked to a table definition so I do not believe zero length strings are involved. The field once populated will go into SQL to do a Select query.
The problem is I cannot place the date text into a null value because I keep getting a 2115 runtime error. I think it may be theoretically impossible but I have not given up yet.
I have gone through the archives and found 13 hits. One person had the same issue but the thread was never answered.
Any help would be appreciated.
Thanks,
EP1