Results 1 to 4 of 4
  1. #1
    hamidchi is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Posts
    4

    Option Group for gender

    Hi
    .
    I wanna use option group in a form for choosing gender(male,female)


    but option group returns number instead of the words "male" or "female"

    how can I have these words in gender column when I press male or female button ?

    ------------------------------
    P.S:
    I read somewhere that the solution is to add a text box and then invisible it and bound it to the gender column
    and . unbound the option group and in property sheet after update . write a code for changing numbers 1 and 2 with words male and female

    please help what code i should write ?

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    In the properties for the option group, change the values, however in your table, what difference does it make. If you need the result in a query or report, then add an expression to the query that converts it to the appropriate text and hide the value field that contains 1 or 2.

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Not at a computer, but if memory serves the option values can only be numeric. An example of an expression:

    =IIf(FieldName = 1, "Male", "Female ")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,413
    and if you have more than 2 options, use the choose function


    choose(fieldname,"Male","Female","Robot")

Please reply to this thread with any new information or opinions.

Similar Threads

  1. option group
    By Sheba in forum Forms
    Replies: 25
    Last Post: 10-21-2014, 02:38 PM
  2. Replies: 4
    Last Post: 10-03-2014, 06:36 AM
  3. How to group people's titles by gender?
    By Idznak in forum Queries
    Replies: 3
    Last Post: 11-17-2013, 09:56 AM
  4. Option Group
    By x__hoE__x in forum Access
    Replies: 2
    Last Post: 12-10-2011, 09:39 AM
  5. Option Group
    By huskies in forum Forms
    Replies: 9
    Last Post: 12-02-2009, 12:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums