Eljefegeneo
Still trying to learn
- Local time
- Today, 11:09
- Joined
- Jan 10, 2011
- Messages
- 904
I am trying to add a new entry to a combo box as a permanent entry.
I have tried
And the module:
Where AddItemCbo is
I typed in the original list.
Both add the item very nicely, but, neither saves them to the Combobox list. When I close the form and open it again, the new items(s) are no longer on the combobox list. Limit to list = No and Allow Value List Edits = Yes. Me.NewQuery is a text box. cboQuery is my combobox.
How do I save the new item(s) to the combobox list?
I have tried
Code:
Dim myQry As String
myQry = Me.NewQuery
Me.cboQuery.AddItem (myQry)
Code:
Dim newQ As String
newQ = Me.NewQuery
AddItemCbo cboQuery, newQ
DoCmd.Save
Code:
Function AddItemCbo(ctrlComboBox As ComboBox, _
ByVal strItem As String)
ctrlComboBox.AddItem Item:=strItem, Index:=0
End Function
Both add the item very nicely, but, neither saves them to the Combobox list. When I close the form and open it again, the new items(s) are no longer on the combobox list. Limit to list = No and Allow Value List Edits = Yes. Me.NewQuery is a text box. cboQuery is my combobox.
How do I save the new item(s) to the combobox list?