A97 option group or combo-box data question?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MLH

    A97 option group or combo-box data question?

    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.
  • Bas Cost Budde

    #2
    Re: A97 option group or combo-box data question?

    MLH wrote:[color=blue]
    > 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[/color]

    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


    Comment

    • MLH

      #3
      Re: A97 option group or combo-box data question?

      I'm part-way there...

      for ClientDataChang ed=-1 to -12 step -1:debug.print
      month(dateadd(" m",ClientDataCh anged,now));yea r(dateadd("m",C lientDataChange d,now)):Next
      ClientDataChang ed
      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.

      Comment

      • Bas Cost Budde

        #4
        Re: A97 option group or combo-box data question?

        MLH wrote:
        [color=blue]
        > I'm part-way there...
        >
        > for ClientDataChang ed=-1 to -12 step -1:debug.print
        > month(dateadd(" m",ClientDataCh anged,now));yea r(dateadd("m",C lientDataChange d,now)):Next
        > ClientDataChang ed[/color]

        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 clientdatachang ed variable)

        --
        Bas Cost Budde, Holland


        Comment

        Working...