Valery
Registered User.
- Local time
- Today, 08:16
- Joined
- Jun 22, 2013
- Messages
- 363
Hi all ! I think I found the coding I need on this site. But I would not know how to adapt it.
I would like an auto text completion combo box that will save NEW data entry so it can be used in the following records.
This is what I found. If this coding is correct, can you please identify for me the sections where I need to make changes and what they are (name of control, name of combo box...)? Also, please confirm where to enter these codes. In a module?
THANK YOU Kindly.
I would like an auto text completion combo box that will save NEW data entry so it can be used in the following records.
This is what I found. If this coding is correct, can you please identify for me the sections where I need to make changes and what they are (name of control, name of combo box...)? Also, please confirm where to enter these codes. In a module?
Code:
Private Sub cboSpindle_AfterUpdate()
'update combo with new entry
Call AddItemToEnd(cboSpindle)
End Sub
Function AddItemToEnd(ctrl As ComboBox)
For i = 0 To ctrl.ListCount
If ctrl = ctrl.Column(i) Then
Exit Function
End If
Next i
' not found, so add it
ctrl.AddItem Item:=ctrl
End Function
THANK YOU Kindly.