By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,501 Members | 2,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,501 IT Pros & Developers. It's quick & easy.

A97 option group or combo-box data question?

P: n/a
MLH
I wish to give user a tool to select period of car purchase.
(IE, the block of time within which sale made)
So, I'm gonna give him an option-group of choices like...
this week
this month
last month
in last 3 months
in last 6 months

And, in case none of the above 5 are good enough to sufficiently
narrow the number of choices, I'm going to give him a combo-box
of the 12 months of the year. That's generally pretty simple, but I
want the choices to 'drop down' this-a-way if he clicks it today...

May 2005
April 2005
March 2005
Feb 2005
Jan 2005
Dec 2004
Nov 2004
Oct 2004
Sep 2004
Aug 2004
Jul 2004
Jun 2004

And if he clicks in Feb '06

Jan 2006
Dec 2005
Nov 2005
Oct 2005
Sep 2005
Aug 2005
Jul 2005
Jun 2005
May 2005
April 2005
March 2005
Feb 2005

The months are sort of backing up, as you can probably see.
I'm sure there's a clever way to do this. Its important to me that
whatever he chooses indicates a date value I can use in code
to determine month & year scope of vehicle sales records to
extract. In another combo-box altogether, I'll let him pick the
vehicle from a shorter list of only those sold in specified mo/yr.
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
MLH wrote:
And, in case none of the above 5 are good enough to sufficiently
narrow the number of choices, I'm going to give him a combo-box
of the 12 months of the year. That's generally pretty simple, but I
want the choices to 'drop down' this-a-way if he clicks it today...

May 2005
April 2005


12 months.

* create a query that returns this set
* base your combobox on that query.

If you need hints on creating a date range, see my website.
--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

Nov 13 '05 #2

P: n/a
MLH
I'm part-way there...

for ClientDataChanged=-1 to -12 step -1:debug.print
month(dateadd("m",ClientDataChanged,now));year(dat eadd("m",ClientDataChanged,now)):Next
ClientDataChanged
5 2005
4 2005
3 2005
2 2005
1 2005
12 2004
11 2004
10 2004
9 2004
8 2004
7 2004
6 2004

Now all I've gotta do is figure how to get this stuff into a query.
Nov 13 '05 #3

P: n/a
MLH wrote:
I'm part-way there...

for ClientDataChanged=-1 to -12 step -1:debug.print
month(dateadd("m",ClientDataChanged,now));year(dat eadd("m",ClientDataChanged,now)):Next
ClientDataChanged


Create a table with just one number field; fill it with values -1
through -12. Base your query on this table, using the expression you
found (substitute the table field for the clientdatachanged variable)

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.