Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Option groups feeding criteria to a query (AccessXP)

    I want to present the user with one form to feed all criteria back to a query. I need to pull in a month

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Option groups feeding criteria to a query (AccessXP)

    Option groups return a numeric value corresponding to the Option Value of the selected option button.
    It would be more efficient to store the month in the table as a number - takes up less space and is easier to use. But it might be too much work to change that now.

    If the January option button has Option Value 1, etc, you can use Format(DateSerial(2000, [Forms]![frmCompileBilling]![frmMonths], 1), "mmmm") to get the month name (2000 is just an arbitrary year; we format the first day in the specified month in 2000 as the full month name).

    Or you can create a separate table with two fields: MonthNumber and MonthName, and fill it with (1, "January") ... (12, "December"). Add this table to the query, join it to your table on the month name field, and set the criterion on the month number.

    BTW, frmMonths is a strange name for an option group. The frm prefix is generally used for forms; grp is a possible prefix for option groups.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option groups feeding criteria to a query (AccessXP)

    Hans once again you proivded excellent support. I used the second method. Something I had never thought about before. Cool. Thanks! This retired Navy officer <img src=/S/salute.gif border=0 alt=salute width=15 height=20> you.

    Yep I am <img src=/S/cooked.gif border=0 alt=cooked width=50 height=46> on the last paragraph. I knew I was wrong there, but hadn't gotten to the books to look up the right one. Thanks for the instructions.

    Fay

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •