![]() |
Dropdown list items and item IDs
Hi
I have a query that retrieves some data from Access database (I get ID, ItemName). I then want to use the data (ItemName) as a source for a drop down list. For this I use: Do While Not rsData.EOF ' Load the dropdown with the recordset values. ddCustomers.AddItem rsData.Fields(1).Value rsData.MoveNext Loop The only problem is when I want to use an item from the list to save it back to the database. Because items in the list box are not distinct (unique) I don't know how to identify them. Can I add items to list boxes with they ID's? Or do I have to relay on the item position in a list box. I would also be thankful if someone could please recommend some good site on this issue, ie recordset manipulation, binding recordsets with list boxes, dropdown lists, etc. Kind regards IgorM |
Dropdown list items and item IDs
hi
one thing is that you have to set the column property in the combo box to 2. then add the items from the record set. see if this helps. http://www.ozgrid.com/forum/showthread.php?t=41675 http://www.fontstuff.com/vba/vbatut10.htm regards FSt1 "IgorM" wrote: Hi I have a query that retrieves some data from Access database (I get ID, ItemName). I then want to use the data (ItemName) as a source for a drop down list. For this I use: Do While Not rsData.EOF ' Load the dropdown with the recordset values. ddCustomers.AddItem rsData.Fields(1).Value rsData.MoveNext Loop The only problem is when I want to use an item from the list to save it back to the database. Because items in the list box are not distinct (unique) I don't know how to identify them. Can I add items to list boxes with they ID's? Or do I have to relay on the item position in a list box. I would also be thankful if someone could please recommend some good site on this issue, ie recordset manipulation, binding recordsets with list boxes, dropdown lists, etc. Kind regards IgorM |
All times are GMT +1. The time now is 06:40 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com