JacobLondonUk
New member
- Local time
- Today, 15:44
- Joined
- Nov 25, 2011
- Messages
- 7
i have a table named DatesTbl
within it i have a field named Date_E with many dates in it
then more fields with other text relating to those dates,
i want to find the info of the other fields by passing a date value to a function and getting back the values of the other fields which are matching to the given date.
i created a function:
Public Function InfoDate(GivenDate As Date) As String
Dim stringOFTodaysDate As String
stringOFTodaysDate = Format(GivenDate, "dd/mm/yy")
InfoDate = DLookup("Otherfields", "datesTbl", "date_e=" & stringOFTodaysDate)
End Function
when i use the function: control.value = InfoDate(date)
it creates an error stating "invalid use of null"
i tried changing from date to string and backwards, tried adding "#" around it, nothing changed it
any one can help me please, much appreciated
thanks
jacob
within it i have a field named Date_E with many dates in it
then more fields with other text relating to those dates,
i want to find the info of the other fields by passing a date value to a function and getting back the values of the other fields which are matching to the given date.
i created a function:
Public Function InfoDate(GivenDate As Date) As String
Dim stringOFTodaysDate As String
stringOFTodaysDate = Format(GivenDate, "dd/mm/yy")
InfoDate = DLookup("Otherfields", "datesTbl", "date_e=" & stringOFTodaysDate)
End Function
when i use the function: control.value = InfoDate(date)
it creates an error stating "invalid use of null"
i tried changing from date to string and backwards, tried adding "#" around it, nothing changed it
any one can help me please, much appreciated
thanks
jacob