Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Option Values in Qeries (2000)

    Hello, how do I set the field on a query to represent the actual name of a selection from an option button opposed to the query returing value 1, 2 etc?

    Many thanks Darren.

  2. #2
    3 Star Lounger
    Join Date
    May 2002
    Location
    Toronto, Ontario, Canada
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Values in Qeries (2000)

    I'm assuming you mean that you want to return the label caption property that corresponds with the option button selected?
    If so, there are at least a couple of options for you... Depending on how many option buttons are in the group...

    You could use an IIF statement and nest the results... For example:
    fldChoice: IIf([Forms]![frmName].[optGroupName]=1,[Forms]![frmName].[lblOneName].[Caption],IIf([Forms]![frmName].[optGroupName]=2, [Forms]![frmName].[lblTwoName].[Caption], [Forms]![frmName].[lblOneName].[Caption])

    Or you could try something like the Choose function...
    =Choose([Forms]![frmName].[optGroupName], [Forms]![frmName].[lblOneName].[Caption], [Forms]![frmName].[lblTwoName].[Caption],[Forms]![frmName].[lblThreeName].[Caption])

    (of course, you'll have to change the names I've used to your own... )

    The Choose looks cleaner... but I haven't tested it... Give both a try... <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    HTH...

  3. #3
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Option Values in Qeries (2000)

    Another option, in addition to the suggestions from Trudi, would be to create a simple two field table with the values that correspond to the results of the option button, join to the table, and display the text that corresponds to the option choosen - you would use the value of the option group as a criteria in the query.
    Wendell

  4. #4
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Values in Qeries (2000)

    Thank you to you both, I am now at home so unable ti try until I return to work tomorrow. On the presumption they will work - thanks again.

    Darren.

Posting Permissions

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