To use the date picker is fairly easy. insert the date picker on to the form. give the date picker a name or use the default name. create your query and in the primary field ( a date) enter the date picker name as the criteria for the query.
Craftsman61, thanks for your respond I tried that and I can not get it to work. This is what I put for my criteria Like [Forms]![form1]![ActiveXCtl0] & '*'. Do you see anything wrong.
I see what you mean hmm I use the date picker in a way that i have the user select a range of dates thus using two date pickers as a criteria for a query.
the criteria formula goes something like this
Between [Forms]![frmForm1]![txtDTPstart] AND [Forms]![frmForm1]![txtDTPend]
If you want me to i probably can get this worked out and get back to you tomorrow. Fixing to have a bunch of meetings for the next several hours.
Try the calendar control to do this. I have tried it here with a temporary database and got it to work. The problem I keep running into with the date time picker is that it always includes a time. This is the problem. If you can figure a way around the time showing up with the date I'm sure that it will work. On the other hand the calendar control activeX component only returns the date. You just need to transfer its value to a textbox - a little on_click coding will easily do that, then base the query criteria on the textbox. Hope that helps, good luck !!
Craftsman61,
I looked into using calendar control but I liked the idea of the drop down box instead of showing the calendar on the form. And I double-checked the date format of my table and date picker and both are short date. Thanks again for your input.
I had the same problem with the Time and Date picker, but had success by taking the value of the Time and Date picker and getting just the date using the date value function, like:
'start code
Dim dtYourDate as Date
dtYourDate = DateValue(Me.DatePickerOcx.Value)
This will return 11/5/2002 instead of 11/5/2002 7:48:59 AM
I had a text box set to equal the value of the date time picker. Even though the date time picker said just the date and its properties as well as the properties of the text box where set to short date the text box would still display the time.
It looks like 'BEEPS' just might have the work around here. I haven't tried it though. Good Luck !
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.