If you talk about native access combos or list box controls, and you are on version 2002 (xp) or higher, then you should easily find it in the help files. It became available in that version, and is not found in prior versions.
Examples from Access' VBA help file
This example adds an item to the end of the list in a list box control. For the function to work, you must pass it a ListBox object representing a list box control on a form and a String value representing the text of the item to be added.
Code:
Function AddItemToEnd(ctrlListBox As ListBox, _
ByVal strItem As String)
ctrlListBox.AddItem Item:=strItem
End Function
This example adds an item to the beginning of the list in a combo box control. For the function to work, you must pass it a ComboBox object representing a combo box control on a form and a String value representing the text of the item to be added.
Code:
Function AddItemToBeginning(ctrlComboBox As ComboBox, _
ByVal strItem As String)
ctrlComboBox.AddItem Item:=strItem, Index:=0
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.