Help with VBA / query design

Moses76

Registered User.
Local time
Today, 03:45
Joined
May 25, 2011
Messages
49
Pasting a snippet from my code

cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\new.mdb"
rst.Open "SELECT Table1.Name FROM Table1 WHERE DateTaken= '" & cal1.Value & "';", cnn, adOpenStatic
rst.MoveFirst

cal1.Value is a value to be picked by the user on a calendar on the form
If I hard code the date ie instead of cal1.value I used 12/26/11 it accepts it . I just want to make it so that it can pick the value from the calendar click event.

Please help

Thanks.
 
What datatype is Value? Is it a string? If not try wrapping it in CStr()
 

Users who are viewing this thread

Back
Top Bottom