select multiple values from a combo box

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

    #1

    select multiple values from a combo box

    Is there a way in Access to store more than one value in a field that has
    been selected from a combo box?

    For example, if a combo box had three values that you can select, "One",
    "Two", and "Three". How do you drop down the list and select a first value
    ("One") then do the same and select a second value ("Two") so that the value
    in the field is now "One, Two". I have situations where I need to do this
    with fields that

    If there is a better way to do this rather than a combo box?


  • LD

    #2
    Re: select multiple values from a combo box

    I am sorry, I did complete a sentence in this message. Here is the post
    again:
    Is there a way in Access to store more than one value in a field that has
    been selected from a combo box?

    For example, if a combo box had three values that you can select, "One",
    "Two", and "Three". How do you drop down the list and select a first value
    ("One") then do the same and select a second value ("Two") so that the value
    in the field is now "One, Two". I have situations where I need to do this
    with fields that with both a "value list" and with a query to other tables.

    If there is a better way to do this rather than a combo box?



    Comment

    • Larry Linson

      #3
      Re: select multiple values from a combo box

      If you feel compelled to use "multi-valued fields" (a violation of good
      relational database design practices), you would have to use VBA code set
      the value... that could be done easily enough with a Text Box bound to the
      field, and an unbound Combo Box with code that would append the selected
      values to the end of the text string in the Text Box. But, I caution that
      you may make more work for yourself when you later need to use that field...
      for example, in queries.

      Larry Linson
      Microsoft Access MVP

      "LD" <wayne_rider@ya hoo.com> wrote in message
      news:dlip0c$7vf $1@murdoch.acc. Virginia.EDU...[color=blue]
      >I am sorry, I did complete a sentence in this message. Here is the post
      >again:
      > Is there a way in Access to store more than one value in a field that has
      > been selected from a combo box?
      >
      > For example, if a combo box had three values that you can select, "One",
      > "Two", and "Three". How do you drop down the list and select a first value
      > ("One") then do the same and select a second value ("Two") so that the
      > value
      > in the field is now "One, Two". I have situations where I need to do this
      > with fields that with both a "value list" and with a query to other
      > tables.
      >
      > If there is a better way to do this rather than a combo box?
      >
      >
      >[/color]


      Comment

      • LD

        #4
        Re: select multiple values from a combo box

        Thanks Larry. I do not expect any queries created in the future will
        include criteria for this field. I am creating a computer job database.
        Three of the fields are "Run Day", "Input" and "Output". There are a
        limited number of input files and output destinations but each job can
        contain one or more run days, input files, and output files.

        Thank you for your help.
        Lloyd

        "Larry Linson" <bouncer@localh ost.not> wrote in message
        news:nT5ff.2781 3$9T4.14418@trn ddc04...[color=blue]
        > If you feel compelled to use "multi-valued fields" (a violation of good
        > relational database design practices), you would have to use VBA code set
        > the value... that could be done easily enough with a Text Box bound to the
        > field, and an unbound Combo Box with code that would append the selected
        > values to the end of the text string in the Text Box. But, I caution that
        > you may make more work for yourself when you later need to use that
        > field... for example, in queries.
        >
        > Larry Linson
        > Microsoft Access MVP
        >
        > "LD" <wayne_rider@ya hoo.com> wrote in message
        > news:dlip0c$7vf $1@murdoch.acc. Virginia.EDU...[color=green]
        >>I am sorry, I did complete a sentence in this message. Here is the post
        >>again:
        >> Is there a way in Access to store more than one value in a field that has
        >> been selected from a combo box?
        >>
        >> For example, if a combo box had three values that you can select, "One",
        >> "Two", and "Three". How do you drop down the list and select a first
        >> value
        >> ("One") then do the same and select a second value ("Two") so that the
        >> value
        >> in the field is now "One, Two". I have situations where I need to do
        >> this
        >> with fields that with both a "value list" and with a query to other
        >> tables.
        >>
        >> If there is a better way to do this rather than a combo box?
        >>
        >>
        >>[/color]
        >
        >[/color]


        Comment

        • fredg

          #5
          Re: select multiple values from a combo box

          On Thu, 17 Nov 2005 15:25:45 -0500, LD wrote:
          [color=blue]
          > I am sorry, I did complete a sentence in this message. Here is the post
          > again:
          > Is there a way in Access to store more than one value in a field that has
          > been selected from a combo box?
          >
          > For example, if a combo box had three values that you can select, "One",
          > "Two", and "Three". How do you drop down the list and select a first value
          > ("One") then do the same and select a second value ("Two") so that the value
          > in the field is now "One, Two". I have situations where I need to do this
          > with fields that with both a "value list" and with a query to other tables.
          >
          > If there is a better way to do this rather than a combo box?[/color]

          It's not a good idea, but if you must .....
          Add a regular text control to your form, bound to the field you wish
          to store the data in.
          Code the Combo AfterUpdate event:
          Me![ControlName] = Me![ControlName] & ", " & Me.[ComboName]
          --
          Fred
          Please respond only to this newsgroup.
          I do not reply to personal e-mail

          Comment

          Working...