Remove combobox values

systemx

Registered User.
Local time
Tomorrow, 06:17
Joined
Mar 28, 2006
Messages
107
Hi all,

I have two linked combobox objects on my form - that are not based on query/table data.

The values are populated using VBA. So if CBO1 Option 1 is selected, I use '.additem' to load the relevant values into CBO2 - and so on for the other options.

Using this works - but of course when the value of CBO1 is changed, it just keeps adding more and more values to CBO2. I only ever want it to display a certain list of values.

Is there a way I can 'reset' the CBO values each time it is changed? '.removeitem' seems like a long way around achieving what I want.

Thanks

Rob
 
Hi Rob

You could use:

ctrlComboBox.RowSource = ""

Although earlier versions of Access VBA did not support this function.
I use Access 2002 and this works fine for me.

HTH
Rgds
Rod
 
Thanks Rod!

Worked like a charm :)
 

Users who are viewing this thread

Back
Top Bottom