Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Change text Box depending on ComboBox selection 1

Status
Not open for further replies.

2ks

Technical User
Jan 13, 2007
54
GB
Can anyone tell me how I can get VBA to automatically return a value in a textbox depending on 5 choices in a combo box.

Thanks
 
Select case on the combobox using the change event.

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
So I guess this starts

Sub Combox1_Change()

But how do I get it to change the textbox depending on value selected.

Cheers
 
Something like:
Code:
Private Sub ComboBox1_Change()
    Select Case ComboBox.Value
    Case value1
        TextBox.Value = value1
        
    Case Value2
        TextBox.Value = Value2
        
    End Select
End Sub

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
Excellent and tweaked to suit with perfect results.

Simple I guess when you know how. daft thing is done far more complicated things before
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top