Passing parameters thru combo selection: ERROR:Data type mismatch criteria expression

MsLady

Traumatized by Access
Local time
Today, 10:01
Joined
Jun 14, 2004
Messages
438
I am trying to pass parameters to my qury thru my combo selection. I keep getting this error "Data type mismatch criteria expression", does anyone have an idea why?
Code:
WHERE (((fShiftWorked([tblTimeLog].[timeStart])=[Forms]![frmOperatorWorkDone]![cboShift] Or IsNull([Forms]![frmOperatorWorkDone]![cboShift]))=True));

I have spent so much time onthis already and i am sick of it :mad:


Attached is my db. Please help me out here.
 

Attachments

I note there are Nulls in your date field, which will cause your function a problem. That is the primary problem. Also, your function is going to return "1" rather than "1st Shift", so will never match the combo.
 
pbaldy said:
I note there are Nulls in your date field, which will cause your function a problem. That is the primary problem. Also, your function is going to return "1" rather than "1st Shift", so will never match the combo.
Thank you soooooooooooooooo much! I have checked my db and fixed it. Got rid of the nulls and also put some validation to ensure that the field is always completed by the user, so the nulls shouldn't happen again. Fixed the combo text also. Works like magic.

You are the best *muah! :)

*sigh of relief
 

Users who are viewing this thread

Back
Top Bottom