Neelsfar,
You've really provided very little information to work with, such as Access version, the data types, EXACT error message (title, number, and text) you are (or if you are not) receiving. The desired results and what is actually happening.
However, as a stab in the dark please try two things:
Please do the following:
Read thru the following link: set the option explicit and do the basic trouble shooting and compile as given in the first few parts.
While you are doing this, also insert right after line3 in the code block:
- debug.print "Your criteria = " & strFilter
Run your code, press <Ctrl><G> to open the immediate window. You will see the result of your string in this the window. Review it for correct format. Copy and paste it back here if you don't see the issue
> Troubleshooting and posting (VBA or SQL) Code