467,087 Members | 1,261 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,087 developers. It's quick & easy.

Data Type Mismatch in Expression Error - Access VBA

This must be a simple mistake, but for some reason I cannot seem to get around it.

I am simply trying to create a report of all employees that have a date filled in in a training column in an access DB. I give the users a drop down list to choose employee type, division, and term status and based on their choices I create the selection criteria for the report. This code works without the ForkTruckClass > '#1-01-1900#' (the below piece is just from when the user selects all employee types and all divisions and terminated = N)

Me.RecordSource = "SELECT * FROM Main_EE_Info " & _
"WHERE ForkTruckClass > '#1-01-1900#' AND Terminated = 'N'"

I have also tried ForkTruckClass <> "" , ForkTruckClass > '1-01-1900' and different date combos but nothing seems to work.. I keep getting DATA TYPE MISMATCH in expression when I execute the report.

The field ForkTruckClass is defined as DATE/TIME - Medium date in my Access Table.

Is there somethign that I am missing?

Thanks in advance!
Feb 5 '08 #1
  • viewed: 3628
2 Replies
Expert 2GB
SQL's not my forte, but I think you need to lose the single quotes around your date:


needs to just be


There may be something else wrong, but try this first.

Welcome to TheScripts!

Linq ;0)>
Feb 5 '08 #2
WOW Thanks! it worked... I never thought about that!!! Really Appreciate the response!
Feb 5 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by igor.barbaric@infotehna.si | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.