Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Strange compile error on ComboBox.AddItem method

Posted on 2003-02-18
2
Medium Priority
?
546 Views
Last Modified: 2007-12-19
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)


0
Comment
Question by:BigJ
2 Comments
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 300 total points
ID: 7980600
The AddItem method does *not* work with form combo boxes in A97. It only works for command bar combo boxes unfortunately. You'll need to use alternative methods such as adding the item to the source table or the combo box's value list.
0
 
LVL 2

Author Comment

by:BigJ
ID: 7985612
Cool. If anyone is interested, I used this code. It's untested but should work.

   Me.ComboBox.Rowsource = Me.ComboBox.Rowsource & "New Data;"
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question