Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot get List1.AddItem to work

Status
Not open for further replies.

vamoose

Programmer
Oct 16, 2005
320
MX
I have a form with a list box on it named List1. I am trying to use VBA (Access 2000) to populate this listbox and keep getting the error with the .AddItem text highlighted: "Method or data member not found" using the following code:

Dim lstitem As ListView
Dim i as Integer
For i=1 to ListView1.ListItems.Count
If ListView1.ListItems.Item(i).Selected = True Then
Me.List1.AddItem ListView1.ListItems.Item(i)
End If
Next i

The List1.RowSourceType is set to Value List

Any suggestions please. Thank you.

 
There is no ListBox.AddItem method prior to Access 2002 unfortunately.

You can code your own routine to alter the RowSource property and achieve the same result.

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top