Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box in Form which shows Calendar for Parameter 2

Status
Not open for further replies.

kmkland

Technical User
Dec 15, 2004
114
0
0
US
I know the end result that I am trying to obtain, but how I need to go about creating the queries and forms, I'm at a loss!
I need to create a form which is based on reports that have date parameter values. Within this form, I would like to have to Combo boxes with the date parameters, and when the user clicks the box, a drop-down menu appears with a calendar instead of values. The Combo boxes are linked to reports that need to be produced.
I already have date parameters set up within the queries that the reports are based on....but where do I go from here??
Any help on this problem would be greatly appreciated!!!
Kindest Regards,
Kmi
 
You need a DateTime picker control that has a drop down like a combo box but drops a calandar rather than a list of items.

Select "Microsoft Windows Common Controls 6.0" under components and the dtPicker control will appear in the tool box.

 
Golom,
I'm not sure I follow you on what I need to do to accomplish this... Where do I need to look for the components?? Is this going to be written in VB?
Kim
 
When building your form, select a control called "Microsoft Date and Time Picker Control 6.0 (SP6)" and place it on your form just as you would a combo box. That control displays a date and, when you click the drop-down arrow, it drops a calandar from which you can select a date.

You can place this control on a form or report (if that makes sense for you) and you can use its value property just as you would use a combo box text property in your code.
 
Golom,
Thanks for the information.
When I go into the properties of the control, I cannot select a control source. Also, how do I select all the queries that I want the dtPicker control to be linked to so I can produce the various reports I need? They are all parameter queries. But in addition to the dates (start and end), I have a combo box which allows the user to choose the month as well. I want to link these controls to the queries/reports but I'm not sure how I need to do it. As I stated before, I know what I want to achieve, I just don't know what I need to do to achieve it!

Kindest regards,
Kim
 
Kim,

Why do you still have a combo box to select the month if you have added the DateTimePicker to the form?

Create a brand new form.

Find the DateTime Picker component on the tool box, (as Golom said: Select "Microsoft Windows Common Controls 6.0" under components and the dtPicker control will appear in the tool box.)

Drop a dtPicker on the form, name it dtStartDate
drop a second dtPicker on the form, name it dtEndDate

In your queries, modify the parameter to:

NewFormName!dtStartDate
NewFormName!dtEndDate

You may need to modify the component slightly in the properties to get the correct format passed to your query.

Leslie
 
Hi Leslie,

OK. I followed your instructions, as well as Golom's, and I am not sure how to modify the Control Source for each dtPicker?? And possibly, when I solve this problem, it will solve my next problem, which is: I'm asked for the parameter "test form!dtStartDate" when I run my reports.

I do appreciate yours and Golom's help on this matter!!

Kim
 
why are you trying to modify the Control Source of the dtPicker?

Leslie
 
Leslie,
I am being asked for "test form!dtStartDate" when I run my report. I am not sure what I need to do to change this.
Any suggestions??
Oh, on the control source matter: I didn't know if I needed to add a control source or not.
Kim
 
I desperately need some help with getting my queries to work with my Date Time Control. I am still being prompted for the parameters from my queries!! I am not an advanced user of Access, but I understand the basics in SQL.
PLEASE help with this problem!!!!
Thanks SOOO much in advance.
Kim
 
Is the parameter like this ?
[Forms]![test form]![dtStartDate]

And is [test form] an opened main form ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PH,
It did help tremendously!!!
Thanks a million!!
Kim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top