listbox doesn't support method (1 Viewer)

casey

Registered User.
Local time
Today, 19:03
Joined
Dec 5, 2000
Messages
448
Hello all,

I have copied a function from Microsoft and when I run the code, an error message appears that the listboxes I'm using do not support either .clear or .addditem methods. Is there a property on the listbox control or a reference I need to add that allows me to manipulate a listbox's contents while it's running?
 

Fornatian

Dim Person
Local time
Today, 19:03
Joined
Sep 1, 2000
Messages
1,396
I believe the code you are using refers to the Visual Basic itself, because list boxes in access are bound you cannot instantly add an item without adding it to the underlying recordset.

What is it you are trying to achieve?
 

casey

Registered User.
Local time
Today, 19:03
Joined
Dec 5, 2000
Messages
448
Actually, I copied a function from Microsoft that lists items into a listbox using the AddItem method. I merely thought that this would be useful and wanted to try it. You're probably correct and the function refers to VB exclusively. If this can't be achieved using Access then it's of no use to me. Thanks for your response.
 

Fornatian

Dim Person
Local time
Today, 19:03
Joined
Sep 1, 2000
Messages
1,396
You can add items to a list box at run time if the object is/isn't bound, but you can't retain them 'easily' without binding the listbox to a table/query.

Me.List0.RowSource = Me.List0.RowSource & "Another Item;"
Me.List0.Requery
 

Users who are viewing this thread

Top Bottom