AddItem method in Access 2000?

  • Thread starter Thread starter VJ
  • Start date Start date
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
 
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
 
Back
Top