Using VBA in Access

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