Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Box (Access 97)

    <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>
    Good Morning,

    I hope someone has a suggestion for me!!!! PLEASE...

    I have a combo and text box. The user makes the selection from the combo box and the choice passes to the text box.

    Problem: I need to find a way for the user to make more than 1 selection from the combo box.

    i.e. COMBO BOX: Cat, Dog, Chicken and Cow
    currently the user selects Cat and it is passed on to the text box. I would like the user to be able to select cat then dog then cow and each pass on to the text box.

    I hope this made sense.

    Thanks in advance.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box (Access 97)

    Hi Roberta,

    Wouldn't a multi-select listbox be a better control choice?

    Otherwise, you could write the following code in the OnChange event of the combo box:<pre>txtTextBox.Value = txtTextBox.Value & ", " & cboComboBox</pre>

    (Separated by a comma)

    One afterthought: Keep in mind that only the BoundColumn value will be moved to the textbox. If you want a column other than the one bound, you'll have to use cboComboBox.Columns(1)...etc.

    HTH <img src=/S/salute.gif border=0 alt=salute width=15 height=20>

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box (Access 97)

    Hi Mark,

    Thanks for the OnChange suggestion, that's what I wanted. One tiny change if I could please. I know the following will give me a hard return in a MSGBOX but it won't in my OnChange code: & Chr(13) &

    I would rather a hard return after each selection and not the comma, could you offer me the answer?

    Thanks again
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  4. #4
    New Lounger
    Join Date
    Nov 2001
    Location
    Twickenham, UK
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box (Access 97)

    using Mark's code:

    txtTextBox.Value = txtTextBox.Value & vbCrLf & cboComboBox

    where 'vbCrLf' gives the carriage return

  5. #5
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box (Access 97)

    <img src=/S/bow.gif border=0 alt=bow width=15 height=15> THANK YOU!!!!!
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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