Avatar of BigJ
BigJ
 asked on

Strange compile error on ComboBox.AddItem method

Access97: I created a fresh database with 1 form and no tables. The form has 1 control - an unbound combo box. You cannot get simpler than this.

Now, the form module has 1 line of code:

   Me.ComboBox.Additem "Item1"

When I compile the database I get a compile error saying ".AddItem method or data member not found".

I think this might have something to do with having installed Access 2002 - I'm still running 97. However, from what I understand there should be no problem running both versions...


In case it helps, the References in Access 97 are:

1. Visual Basic for Applications (..\common files\MS shared\VBA\VBA332.dll)
2. MS Access 8.0 Object Library (..\Office\MSACC8.OLB)
3. MS DAO 3.51 Object Library (..\common files\MS shared\DAO\DAO350.dll)


Microsoft Access

Avatar of undefined
Last Comment
BigJ

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
shanesuebsahakarn

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
BigJ

ASKER
Cool. If anyone is interested, I used this code. It's untested but should work.

   Me.ComboBox.Rowsource = Me.ComboBox.Rowsource & "New Data;"
Your help has saved me hundreds of hours of internet surfing.
fblack61