Fordraiders
asked on
I keep getting type mismatch
access 365
I keep getting type mismatch on this statement ?
racfid = 'bbbbb'
f.fields(1) = "2/5/2020 10:52:53 AM" ' date format
Date is ahowing as "02/05/2020"
' set the access temp local table just in case i need it.
Set r = CurrentDb.OpenRecordset("S elect [racfid], [Logged_In], [Logged_Out] from qry_CurrentUser where [racfid] = '" & racfid & "'", dbOpenDynaset, dbSeeChanges)
If Len(Nz(r.Fields(1), "")) > 0 Then
If (r.Fields(0) = racfid) And (DateValue(r.Fields(1)) = Date) Then
MsgBox "You are Logging out of the Tracker, vbCritical", "Log Out Issue" <--------- error here ?
r.Edit
r![Logged_Out] = Now()
r.Update
r.Close
Set r = Nothing
I keep getting type mismatch on this statement ?
racfid = 'bbbbb'
f.fields(1) = "2/5/2020 10:52:53 AM" ' date format
Date is ahowing as "02/05/2020"
' set the access temp local table just in case i need it.
Set r = CurrentDb.OpenRecordset("S
If Len(Nz(r.Fields(1), "")) > 0 Then
If (r.Fields(0) = racfid) And (DateValue(r.Fields(1)) = Date) Then
MsgBox "You are Logging out of the Tracker, vbCritical", "Log Out Issue" <--------- error here ?
r.Edit
r![Logged_Out] = Now()
r.Update
r.Close
Set r = Nothing
Maybe this is a part of a Function and you have declared the racfid as Numeric and you are feeding alphanumeric
ASKER
racfid is a alpha numeric string- text
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks scott
racfid = 'bbbbb'
also check your date fields are atual date type andd not text type, If they are Text fields, you will probably get that error trying to set a text field to a date value. Also make sure that there are no records that do not have a valid date in the date fields