How to update a combobox selection from a text box?

Shankar14

New member
Local time
Today, 06:28
Joined
Apr 6, 2022
Messages
7
Is it possible via VBA to select an item from a combobox drop down where the value is from an input text box?

Using VBA option 'after update', Is it possible to redefine combobox row source if already bound ?
 
"Is it possible via VBA to select an item from a combobox drop down where the value is from an input text box?"

Yes.

"Using VBA option 'after update', Is it possible to redefine combobox row source if already bound ?"
Yes.

Now, if you want some examples of HOW to do those things....
Really simplistic approaches:

Private Sub txtInPutBox_AfterUpdate()

Me.ComboBox = txtInPutBox

End Sub

Unfortunately, "Using VBA option 'after update'..." isn't enough to go on. "After update" of "what" matters here.
 
Using VBA option 'after update', Is it possible to redefine combobox row source if already bound ?
Yes, it is possible.
Code:
Dim sRowSource As String
    sRowSource= "Select ... From ... "
    If Len(Me.txtFild & "" > 0 Then
        sRowSource= sRowSource & " Where [Your fied name] = '" & Me.txtFild & "'"
    End if
    
    Me.ComboBoxName.RowSource = sRowSource
 

Users who are viewing this thread

Back
Top Bottom