by Thasnake (2 Submissions)
Category: Miscellaneous
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Thu 12th September 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Procedure that saves the text typed into a combobox into the comboboxes list. Like Internet Explorer address bar.
On Error GoTo Err:
Dim val As String
Dim i As Long
Dim match As Boolean
val = Trim(cboName.Text)
For i = 0 To cboName.ListCount - 1
If cboName.List(i) = val Then
match = True
Exit For
Else
match = False
End If
Next i
If match = False Then
cboName.AddItem val
'You could add code here to save the values
'to a file or registry or something like that
'so they can be loaded back in next time
'program is started
End If
Exit Sub
Err:
MsgBox "Sorry, there was an error!. " & vbCrLf & _
"Please try again.", vbExclamation, "Error"
End Sub
No comments have been posted about Procedure that saves the text typed into a combobox into the comboboxes list. Like Internet Explore. Why not be the first to post a comment about Procedure that saves the text typed into a combobox into the comboboxes list. Like Internet Explore.