Stapman
asked on
ListBox lines
How do I add a line to my listbox? When I use rowsource the line is written over the existing line instead of adding a new line.
Thanks
Thanks
ASKER
I know the question seems stupid but AddItem doesn't work!
My source:
Set Db = CurrentDb
Set Rs = Db.OpenRecordset("Data")
If Rs.RecordCount > 0 Then
Rs.MoveFirst
For Each Element In list_2.ItemsSelected
Rs.index = "Age"
Rs.Seek "=", Integervariable
list1.AddItem = Rs!Name
Next Element
End If
list1.AddItem doesn't work (method / object not found)
My source:
Set Db = CurrentDb
Set Rs = Db.OpenRecordset("Data")
If Rs.RecordCount > 0 Then
Rs.MoveFirst
For Each Element In list_2.ItemsSelected
Rs.index = "Age"
Rs.Seek "=", Integervariable
list1.AddItem = Rs!Name
Next Element
End If
list1.AddItem doesn't work (method / object not found)
I don't know if you just typed it wronly, but it should read
list1.additem rs!name (i.e. without the equals sign)
If that isn't the problem, try setting a string var to rs!name first..
fred=rs!name
list1.additem fred
then if the error is on the fred=... line, the field 'name' might be missing or something...
list1.additem rs!name (i.e. without the equals sign)
If that isn't the problem, try setting a string var to rs!name first..
fred=rs!name
list1.additem fred
then if the error is on the fred=... line, the field 'name' might be missing or something...
ASKER
None of your suggestions solve my problem. I think the problem lies in the fact that "additem" is a not known method to my object. Resulting in the idea that my object isn't a "standard" listbox or I changed some properties of the listbox which result in this problem.
When you type "list1." you get a list of methods you can use and "additem" is not part of that list. Any idea what's wrong?
When you type "list1." you get a list of methods you can use and "additem" is not part of that list. Any idea what's wrong?
I think that you use a DBListBox instead of a ListBox control.
You can't mix lines from the database and manually added lines. What you have to do is to completely populate your list. So you retrieve a recordset than add it lines to your listbox (with the AddItem method).
You can't mix lines from the database and manually added lines. What you have to do is to completely populate your list. So you retrieve a recordset than add it lines to your listbox (with the AddItem method).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The method "Clear" doesn't exist with "my" listbox (nor does AddItem).
Furthermore I have an empty ListBox and selected "value list" in the properties of the ListBox.
How Do I create a ListBox - how do I create a DBListBox? Is the property "value list" / "table" the difference between the two?
Furthermore I have an empty ListBox and selected "value list" in the properties of the ListBox.
How Do I create a ListBox - how do I create a DBListBox? Is the property "value list" / "table" the difference between the two?
When you click on the 'listbox' on the screen and go to properties, what does it say at the top of the properties page ??
something like
lstmylist ListBox ??
something like
lstmylist ListBox ??
ASKER
Something like:
ListBox: Name
*I have a german version of Access
ListBox: Name
*I have a german version of Access
Access ???? I thought you were using VB !!!
aggghhrrrrr !!
aggghhrrrrr !!
ASKER
The method "Clear" doesn't exist with "my" listbox (nor does AddItem).
Furthermore I have an empty ListBox and selected "value list" in the properties of the ListBox.
How Do I create a ListBox - how do I create a DBListBox? Is the property "value list" / "table" the difference between the two?
Furthermore I have an empty ListBox and selected "value list" in the properties of the ListBox.
How Do I create a ListBox - how do I create a DBListBox? Is the property "value list" / "table" the difference between the two?
sigh. Have customer service pull this Q and then repost it over in the Database/Access area. This is the VB/Database area and the programs are completely different.
M
M
This question was awarded, but never cleared due to the JSP-500 errors of that time. It was "stuck" against userID -1 versus the intended expert whom you awarded. This corrects the problem and the expert will now receive these points; points verified.
Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.
This is the Community Support link, if help is needed, along with the link to All Topics since many new ones were recently added.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
https://www.experts-exchange.com/jsp/zonesAll.jsp
Thanks,
Moondancer
Moderator @ Experts Exchange
Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.
This is the Community Support link, if help is needed, along with the link to All Topics since many new ones were recently added.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
https://www.experts-exchange.com/jsp/zonesAll.jsp
Thanks,
Moondancer
Moderator @ Experts Exchange
or am I missing the point ??