how to search months name and year using dtpicker?

i use this format for months and year in formload..
DTPicker1.CustomFormat = "MMMM, yyyy"

but when i use this for searching.. it doesn't see what month and yr that i inputed

this is my code:

.Open ("SELECT * from qryRTS WHERE RTSDate = #" & DTPicker1 & "#"), conn, 3, 3

need help.. thanks

Add the DateValue statement to get the correct data -

.Open ("SELECT * from qryRTS WHERE RTSDate = DateValue('" & DTPicker1.Value & "')", conn, 3, 3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.