VB6 SP5
Access 2002
Listbox = lstLogDates
Field = tblLog.Date (date/time) format
The listbox will have a list of dates. When I click on the dates in the listbox, I want it to return data from the database to a listview. Anyway, I'm running into problems when I query the database. When I click on the Dates in the listbox, I get the following error.
Error Message
Run-time error '3464'
Data type mismatch in criteria expression
The folloing code is where the problem lies.
Doesn't work
"WHERE tblLog.Date='" & lstLogDates.Text & "'", dbOpenSnapshot)
OR
Doesn't work
"WHERE tblLog.Date='" & CDate(lstLogDates.Text) & "'", dbOpenSnapshot)
Access 2002
Listbox = lstLogDates
Field = tblLog.Date (date/time) format
The listbox will have a list of dates. When I click on the dates in the listbox, I want it to return data from the database to a listview. Anyway, I'm running into problems when I query the database. When I click on the Dates in the listbox, I get the following error.
Error Message
Run-time error '3464'
Data type mismatch in criteria expression
The folloing code is where the problem lies.
Doesn't work
"WHERE tblLog.Date='" & lstLogDates.Text & "'", dbOpenSnapshot)
OR
Doesn't work
"WHERE tblLog.Date='" & CDate(lstLogDates.Text) & "'", dbOpenSnapshot)