Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox Dates query

Status
Not open for further replies.

fileman1

Technical User
Feb 7, 2013
152
GB
I have a list box with dates queried from table records.
I am trying to run a query against a date picked.

Part of my SQL line is:
MAIN.[DateLogged] >= #" & Format([Forms]![Copy of MainForm]![M5], "yyyy/mm/dd") & "#"

However in debug.print, it produces:
MAIN WHERE 1 = 1 AND MAIN.[DateLogged] >= #1900/01/18#

A bit different from what is in the list 27/02/2013

Can someone tell me how to correct. The listbox name is M5

 
Sorry, I would get back but now I have a "Reserved error -3201" for which Access is so good, it has no details for it.

I can compile the db code and it shows no errors. ???
 
I raised the question of the reserved error as a separate issue on the Forms Forum. However reported it to be a corrupted list box. I stripped a complete form down to find it, 2 hours later I fixed it. Now my list date query works using the code posted. Maybe someone on this forum knows where/if one can find reserved error numbers/descriptions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top