Add item Listbox control

  • Thread starter Thread starter Domac
  • Start date Start date
D

Domac

Hi,

How to add item into unbounded Listbox control from code.
I used to do this with listbox1.Add method in classic VB , what is solution
in VBA (A97) ??


Thanks!
 
If the list box's RowSourceType is set to Table/Query, execute an append
query to add the item to the table, and then Requery the list box.

If the RowSourceType is Value List, append an item to the RowSource. For
example if the RowSource contains:
"first", "second", "third"
then this kind of thing should work (without testing):
Me.List1.RowSource = Me.List1.RowSource & ", ""fourth"""
 
Thanks!





Allen Browne said:
If the list box's RowSourceType is set to Table/Query, execute an append
query to add the item to the table, and then Requery the list box.

If the RowSourceType is Value List, append an item to the RowSource. For
example if the RowSource contains:
"first", "second", "third"
then this kind of thing should work (without testing):
Me.List1.RowSource = Me.List1.RowSource & ", ""fourth"""
 

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

Back
Top