Combo box with changing content

  • Thread starter Thread starter maxbrit
  • Start date Start date
M

maxbrit

Hello

We have a form that a user has designed that has 15 combo boxes on, the
table the combo box refers to has 15 items in it.

This means that a user could select the same item 15 times.

How can we configure the form/combo box so that once an item has been
selected it will not appear in the next combo box dropdown list?

Thanks for any help.

Max
 
First of all, when you say 'configure' I imagine that you do not really want
to write code.
There may be a way to do this without writing any code, but I don't know it.
However there are a couple of methods requireing a small amount of code that
you could consider:

Instead having combo boxes 'Bound' to the table(I assume this is what you
have at the moment), you could create them as unbound and load the values in
via code.
This would give you much more control over what is in them, you could use
the 'RemoveItem' method to take values out that had been selected elsewhere.


Or I suppose you could change the query (in code) that the ComboBoxes are
based on:

SELECT ComboValue FROM myTable
WHERE ComboValue not in ('<combo1.Text>','<combo2.Text ... etc)

You would have to build that 'not in' string somehow, mybe a function or
somthing, and you would have to make sure that it got refreshed everytime a
value in one of the comboboxes got changed.

ChrisM
 
It sounds to me a Multi-Select ListBox is much more convenient in this case.

Check Access Help on the ListBox and the Multi-Select Property.
 
Back
Top