Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2006
    Posts
    21

    Unanswered: intelligent combo boxes

    Hey guys i appreciate some help here

    i have 12 combo boxes that i need to select a value from, the row source for these combo boxes is a query that only makes a select to a column in tableX

    my problem is: cmbbox1 selects something (no problem there)
    cmbbox2 since it has the same row source it will have a duplicate
    cmbbox3 would have the same problem
    and so on till we hit cmbbox12, so my intention is to have no duplicates while selecting a value from any combo box from this list,

    how can i accomplish this??

    thanx for all your help

  2. #2
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201
    First of all, I would refer you to some recent posts on combo boxes and particularly cascading combo boxes where the content of one combo box provides a parameter for populating the next box and so on. This is, I think a variant on the theme, but in this case the selections are parallel and not hierarchical. You will need to generate a query to use as each combo box's RowSource which will select all records in the table, except those which have been identified in other combo boxes. The general form of the query will be

    SELECT <required fields> FROM table WHERE (data <> ComboBox1 AND data <> ComboBox2 AND . . .). One complication is that you will need to include exceptions where the combo boxes have not been populated yet, probably using IIf() or IsNull() functions.

    In an AfterUpdate or Click event in each combo box you should insert some VBA code which requeries all of the other combo boxes.

  3. #3
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201
    After I did my last post, I had an afterthought. Thinking about null values and such like, which are a considerable complication, you could simplify your problem by forcing the combo boxes to be populated in a particular order (top to bottom, left to right). If you select a combo box out of order, an error message is generated and the focus is transferred to the combo box you should have been using. Then the RowSources need only refer to the preceding Combo boxes.

  4. #4
    Join Date
    Mar 2006
    Posts
    21
    cool let me take a crack at it... As simple as access looks man its one tricky pickle... thanx alot for your help... i will post back my results.

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if each combo box is showing the same result, then that suggests they are bound to the same column (Access speak to they are showing the same value from the table.

    although there is no reason why you couldnt' have say 12 combo boxes.. I think waht you may be after is allowing multiple selections in one combo box
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    or a listbox with the ability to select multiple values (multi-select set to simple).
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  7. #7
    Join Date
    Mar 2006
    Posts
    21
    you are correct healdem each combo is tied to my table, but what i wanted to do is have them linked all together, i did some research about the cascading drop downs that however is linked or bounded to the first combo box and i dont want that, as this will be a configuration form in order to run a report based on the selection that was previously handed to it, so there cannot be dups in the configuration hence the problem of this, i think if i have my tables correctly i would not even permit me to have dups, correct me if i'm wrong...

Posting Permissions

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