AddItem method in Access 2000?

V

VJ

Hello all:
I used the AddItem method to add values to a
ComboBox on a form. I wrote this code in Access 2002 using
the Access 10.0 library. When I run this code in Access
2000, the method AddItem is not recognized. Is there an
equivalent of AddItem in Access 2000?

Thanks,
VJ
 
A

Albert D. Kallal

The addItem does not exist prior to a2002.

However, since the results are just a string, the you could for example fill
a list box with 1 to 10 via:


for i = 1 to 10
if strBuf <> "" then strBuf = strBuf & ";"
strBuf = strBuf & i
next i

me!cboMyCombo.RowSource = strBuf

It is usually better to base the combo box on a table, and then simply add
values to that table, you then just requery the combo and it re-loads.
Generally this is less work then even additem.

Further, last by not least, you can map an array, or set of values directly
to combo box with a call back function. Check out:

http://www.mvps.org/access/forms/frm0049.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top