Using VBA in Access

A

Anika

I am developing a form in access. Since I know little bit
of VB therefore, I am doing coding to make forms more
flexible. But for soem reason I cannot find VB methods
like addItem, and removeItem for list boxes. If I use
those mthods with Lit Box object, then I get an error
method not found.
Help will be greatly appreciated on this.
 
R

Rick Brandt

Anika said:
I am developing a form in access. Since I know little bit
of VB therefore, I am doing coding to make forms more
flexible. But for soem reason I cannot find VB methods
like addItem, and removeItem for list boxes. If I use
those mthods with Lit Box object, then I get an error
method not found.
Help will be greatly appreciated on this.

Even though the VBA in Access is based on the same VB you're
used to, this doesn't mean that everything "crosses over".
In particular, the form objects have many differences
between Access and VB and you have found one of them.
ListBoxes and ComboBoxes in Access do not have an AddItem
method (although in A2k2 I believe this was added for
ListBoxes).

In Access these are most often filled by pulling data from
tables/queries or for short (static) lists you can use a
value list when designing the form.

It is also possible to build a call-back function to
populate a list for the two controls. It's a bit
complicated and I have only used it once or twice. If you
do a google search on th etopic you will likely find some
examples of that.
 

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