A
Al
I have an access (2003) database with a sql backend. I am having problem with
an error message "Type mismatch". The code break on the following line:
dteLoginDate = DLookup("DateLogged", "tbluserlog", "LogID=" & intLogID & "")
& " " & _
DLookup("TimeLogged", "tbluserlog", "LogID=" & intLogID & "")
dteLoginDate is identified as a date (dim dteLoginDate as Date). However,
when I debug, I noticed that the value returned by the Dlookup to
dteLoginDate is (12:00:00 AM) not a date. I tried the following:
dteLoginDate = Format(DLookup("DateLogged", "tbluserlog", "LogID=" &
intLogID & "") & " " & _
DLookup("TimeLogged", "tbluserlog", "LogID=" & intLogID & ""),
"Short Date")
Still the same result. I have the field in the SQL server set as a
smallDateTime, this makes the date show as a long date format i.e. date and
time are showing. is there a way to make this field accept just date. why the
line I am using above is not working?
any ideas
thanks
an error message "Type mismatch". The code break on the following line:
dteLoginDate = DLookup("DateLogged", "tbluserlog", "LogID=" & intLogID & "")
& " " & _
DLookup("TimeLogged", "tbluserlog", "LogID=" & intLogID & "")
dteLoginDate is identified as a date (dim dteLoginDate as Date). However,
when I debug, I noticed that the value returned by the Dlookup to
dteLoginDate is (12:00:00 AM) not a date. I tried the following:
dteLoginDate = Format(DLookup("DateLogged", "tbluserlog", "LogID=" &
intLogID & "") & " " & _
DLookup("TimeLogged", "tbluserlog", "LogID=" & intLogID & ""),
"Short Date")
Still the same result. I have the field in the SQL server set as a
smallDateTime, this makes the date show as a long date format i.e. date and
time are showing. is there a way to make this field accept just date. why the
line I am using above is not working?
any ideas
thanks