View Full Version : Combo box list data.


MarkSimm
07-12-2001, 03:42 AM
I have a combo box on a form and I want to be able to change the value list items depending on certain user events.

I need to know....

Can you clear all of the list elements in a combo box (so it is empty) in the forms VBA script?

Can you add string items to the list in the forms VBA script?

Hope you can help

Mark

charityg
07-12-2001, 06:28 AM
cboName.rowsourcetype="value list"
cboName.rowsource="this;that;the other"

I think this should work.

~Charity

KeaganQuilty
07-12-2001, 06:32 AM
To get the ComboBox Empty, use this syntax.

ComboBoxName.rowsource = ""

This makes for a pretty useless combobox however.

I use comboboxes in my tables all the time. The best way to change the values listed in them is to change the Rowsource property of the combobox.

i.e.

combobox.rowsource = "SELECT DISTINCTROW [Table/Query]![Field] FROM [Table/Query]"

Hope this helps you out.

Keagan Quilty
Kilbride, Newfoundland

MarkSimm
07-12-2001, 07:39 AM
Sorted, thanks dudes. http://www.access-programmers.co.uk/ubb/redface.gif)

Mark