• Combo Box (Access 97)

    Author
    Topic
    #366121

    crossfingers
    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.

    Viewing 0 reply threads
    Author
    Replies
    • #566846

      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:

      txtTextBox.Value = txtTextBox.Value & ", " & cboComboBox

      (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 salute

      • #566868

        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

        • #566870

          using Mark’s code:

          txtTextBox.Value = txtTextBox.Value & vbCrLf & cboComboBox

          where ‘vbCrLf’ gives the carriage return

    Viewing 0 reply threads
    Reply To: Combo Box (Access 97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: