Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Combo Box

Discussion in 'Information Technology' started by Jamie, Jul 28, 2006.

Tags:
  1. Jamie

    Jamie
    Expand Collapse
    Guest

    I have recently taken over a database designed by someone else. I would like
    to make a report using a combo box that was set up using a # to identify a
    field. I would like to show the value instead of the # in my report (eg.
    1=Female, 2=Male).When I create the query only the number shows. How do I do
    this. I would like to keep the # for inputing as it is easier than typing in
    the value.
    Any help is greatly appreciated. Thanks. Jamie
     
  2. Loading...


  3. OP
    Jeff Boyce

    Jeff Boyce
    Expand Collapse
    Guest

    Jamie

    Add a field into your query. Use the IIF() function to derive "Male" or
    "Female", based on the #.

    Use that new field instead of the # field.

    Regards

    Jeff Boyce
    Microsoft Office/Access MVP


    "Jamie" <Jamie@discussions.microsoft.com> wrote in message
    news:6CA6D7CE-BB5B-422B-AAE5-FB9B697557C1@microsoft.com...
    >I have recently taken over a database designed by someone else. I would
    >like
    > to make a report using a combo box that was set up using a # to identify a
    > field. I would like to show the value instead of the # in my report (eg.
    > 1=Female, 2=Male).When I create the query only the number shows. How do I
    > do
    > this. I would like to keep the # for inputing as it is easier than typing
    > in
    > the value.
    > Any help is greatly appreciated. Thanks. Jamie
     
  4. OP
    Al Camp

    Al Camp
    Expand Collapse
    Guest

    Jamie,
    Formatting Male for a 1 and Female for a 2 on a report will not have any effect on how
    you enter the 1 or 2 on your form. So, no worry on that.

    Assuming a field called Gender with numeric values of either 1 or 2...
    On your report, place an unbound text control with a ControlSource of...

    = IIF(Gender = 1, "Male", "Female")

    Now instead of displaying the Gender number you'll get "Male or "Female"

    And... don't forget options for 3 = "Transgender" or 4 = "Not Sure".... :-D

    --
    hth
    Al Camp
    Candia Computer Consulting - Candia NH
    http://home.comcast.net/~cccsolutions

    "Jamie" <Jamie@discussions.microsoft.com> wrote in message
    news:6CA6D7CE-BB5B-422B-AAE5-FB9B697557C1@microsoft.com...
    >I have recently taken over a database designed by someone else. I would like
    > to make a report using a combo box that was set up using a # to identify a
    > field. I would like to show the value instead of the # in my report (eg.
    > 1=Female, 2=Male).When I create the query only the number shows. How do I do
    > this. I would like to keep the # for inputing as it is easier than typing in
    > the value.
    > Any help is greatly appreciated. Thanks. Jamie
     
  5. OP
    Jamie

    Jamie
    Expand Collapse
    Guest

    Jeff,
    I'm not sure what you mean. Still pretty new.

    "Jeff Boyce" wrote:

    > Jamie
    >
    > Add a field into your query. Use the IIF() function to derive "Male" or
    > "Female", based on the #.
    >
    > Use that new field instead of the # field.
    >
    > Regards
    >
    > Jeff Boyce
    > Microsoft Office/Access MVP
    >
    >
    > "Jamie" <Jamie@discussions.microsoft.com> wrote in message
    > news:6CA6D7CE-BB5B-422B-AAE5-FB9B697557C1@microsoft.com...
    > >I have recently taken over a database designed by someone else. I would
    > >like
    > > to make a report using a combo box that was set up using a # to identify a
    > > field. I would like to show the value instead of the # in my report (eg.
    > > 1=Female, 2=Male).When I create the query only the number shows. How do I
    > > do
    > > this. I would like to keep the # for inputing as it is easier than typing
    > > in
    > > the value.
    > > Any help is greatly appreciated. Thanks. Jamie

    >
    >
    >
     
  6. OP
    fredg

    fredg
    Expand Collapse
    Guest

    On Tue, 20 Jun 2006 12:12:03 -0700, Jamie wrote:

    > I have recently taken over a database designed by someone else. I would like
    > to make a report using a combo box that was set up using a # to identify a
    > field. I would like to show the value instead of the # in my report (eg.
    > 1=Female, 2=Male).When I create the query only the number shows. How do I do
    > this. I would like to keep the # for inputing as it is easier than typing in
    > the value.
    > Any help is greatly appreciated. Thanks. Jamie


    Use an unbound text control.
    =IIf([FieldName] = 1,"Female","Male")

    If there is a chance that neither has been selected:
    =IIf([FieldName] = 1,"Female",IIf([FieldName] = 2,"Male","Not
    Selected"))
    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail
     
Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     


Share This Page