Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2008
    Posts
    1

    Unanswered: Microsoft Access-Drop Down List

    I've created an Access database with dropdown lists for 2 fields. Is it possible to set up a drop down list so that 2 of the items on the dropdown list can be selected, instead of only one item?
    For example, let's say the dropdown list is a group of foods (apple, orange, bread, butter). I want to select apple and bread for that entry. Is that possible? Or...must I just type in both items manually?
    Thanks in advance!
    Last edited by loquin; 11-23-08 at 15:25. Reason: no need to shout...

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    moved to access topic
    George
    Home | Blog

  3. #3
    Join Date
    Feb 2004
    Posts
    214

    ...

    I am not aware of a way.
    You could have multiple combo boxes hidden, and the next one appears after the one before it has a value. Kinda ugly though.
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Comboboxes (DropDown) only allow one selection at a time. You don't say what you're using it for, but if you wanted to enter several selections in a textbox, for instance, you could use:

    Code:
    Private Sub YourComboBox_AfterUpdate()
     If IsNull(Me.TargetTextBox) Then
       Me.TargetTextBox = Me.YourComboBox
     Else
       Me.TargetTextBox = Me.TargetTextBox & vbNewLine & Me.YourComboBox
      End If
     End Sub
    or
    Code:
    Private Sub YourComboBox_AfterUpdate()
     If IsNull(Me.TargetTextBox) Then
       Me.TargetTextBox = Me.YourComboBox
     Else
       Me.TargetTextBox = Me.TargetTextBox & ", " & Me.YourComboBox
      End If
     End Sub
    Each time you make a selection it will be added to the textbox. The first example places each selection on a separate line

    Apple
    Bread


    the second example places a comma between each item

    Apple, Bread

    If you want to make multiple selections without doing this you'd need to use a ListBox with Multiple Selections set to Yes. The drawback is that a ListBox takes up much more real estate on a form.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Or you can use a multi-select listbox.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Quote Originally Posted by Missinglinq
    If you want to make multiple selections without doing this you'd need to use a ListBox with Multiple Selections set to Yes.
    Stars in your eyes, Trekker?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Something like that ^^
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  8. #8
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Uh,huh!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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