Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dynamically add/remove combo items (Access 2003, XP SP 3)

    for the purposes of implementing a "forced range" on a set of questions, is there a way (that is not incredibly painful) to set options in a set of combo boxes to only display choices not already selected in the existing set of combo boxes? my first stab at this in VB indicates one can only add/remove items one at a time.

    TIA

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: dynamically add/remove combo items (Access 2003, XP SP 3)

    If the Row Source Type of the combo boxes is Value List, you can use AddItem and RemoveItem to change the list; you can indeed add/remove only one item at a time that way. Another option is to assemble the list of values as a string and set the Row Source property to that string.

    If the Row Source Type of the combo boxes is Table/Query, you could create queries or SQL strings that return only records that haven't been selected in any of the other combo boxes.

    A completely different possibility is to use a multi-select list box.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: dynamically add/remove combo items (Access 200

    thanks - i found this method:

    Case 5
    Me.Q2.RowSourceType = "Table/Query"
    Me.Q2.RowSource = "Not5"

    works much better than manual add/removeitem.

    BTW, your suggestion yesterday on the SQL EXISTS and subqueries did the trick, basically. thanks!

Posting Permissions

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