I am using a DLooking Statement to pull a persons birthdate from another table and populate a unboundbound text box in my form bound to different table. This statement appears to work and pulls in the create date. I say appears because it put a # on either side of the date it pulls in-ie #06-June-91#
Here is the code:
--------
DLookup("Birthdate", "tbl_clientinfo", "ClientID = " & Me.SCVClientID) & _
"#"
-------
I then use the dateadd function to determine the value of a boundfield named "statoflimits". When I fire the event by putting adate in my accidentdate field I get an errorcode 13 typemismatch error on the first line of my subroutine. Here is the subroutine.
Private Sub AccidentDate_AfterUpdate()
If DateAdd("yyyy", 18, Me.Txt14) > Me.AccidentDate Then
Me.StatofLimits = DateAdd("yyyy", 20, Me.Txt14)
Else
Me.StatofLimits = DateAdd("yyyy", 2, Me.AccidentDate)
End If
End Sub
Can anyone help?
Here is the code:
--------
DLookup("Birthdate", "tbl_clientinfo", "ClientID = " & Me.SCVClientID) & _
"#"
-------
I then use the dateadd function to determine the value of a boundfield named "statoflimits". When I fire the event by putting adate in my accidentdate field I get an errorcode 13 typemismatch error on the first line of my subroutine. Here is the subroutine.
Private Sub AccidentDate_AfterUpdate()
If DateAdd("yyyy", 18, Me.Txt14) > Me.AccidentDate Then
Me.StatofLimits = DateAdd("yyyy", 20, Me.Txt14)
Else
Me.StatofLimits = DateAdd("yyyy", 2, Me.AccidentDate)
End If
End Sub
Can anyone help?