By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,583 Members | 3,481 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,583 IT Pros & Developers. It's quick & easy.

Data Type Mismatch in Expression Error - Access VBA

P: 5
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
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 3,532
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

P: 5
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.