How do I get DatePicker (ActiveX Control) to feed value(s) into a.

G

Guest

Hi,

I am building an interface form that I am using the DatePicker (ActiveX
Control) so that it will feed the selected date range into a query that I
have built. How do I get the dates to feed into the query's field?
 
A

Arvin Meyer

I am building an interface form that I am using the DatePicker (ActiveX
Control) so that it will feed the selected date range into a query that I
have built. How do I get the dates to feed into the query's field?

You'll have to feed them from a form. Use a dialog form to display the dates
in unbound textboxes, then refer to them in your query:

Select * From MyTable Where DateField >= [Forms]![frmDateDialog]![DateStart]
And <= [Forms]![frmDateDialog]![DateEnd];

Your Date picker can be activated on the double-click event of the textbox.
You might also consider using an Access form to do the same thing. A sample
calendar form is on my website:

http://www.datastrat.com/Download/Calendar2K.zip
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
G

Guest

a very good example of what you are looking for is in the microsoft office
samples/solutions

Arvin Meyer said:
I am building an interface form that I am using the DatePicker (ActiveX
Control) so that it will feed the selected date range into a query that I
have built. How do I get the dates to feed into the query's field?

You'll have to feed them from a form. Use a dialog form to display the dates
in unbound textboxes, then refer to them in your query:

Select * From MyTable Where DateField >= [Forms]![frmDateDialog]![DateStart]
And <= [Forms]![frmDateDialog]![DateEnd];

Your Date picker can be activated on the double-click event of the textbox.
You might also consider using an Access form to do the same thing. A sample
calendar form is on my website:

http://www.datastrat.com/Download/Calendar2K.zip
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top