View Full Version : Fill a textbox depending on Combo box information


dfuas
06-09-2006, 03:29 AM
Hello everyone,

I have a combo box filled with info. from a sql server table. And I want to fill a text box with some information depending of the selection I make from the combo box. Can anyone help please?

I have a table with 3 fields, id, priority, and description, and a combo box filled on the form load event with the priority field info. I have also a text box which I plan to fill with description info. depending on the selected combo box value.

How do I do this? It is driving me nuts

Thanks.

cvdnest
06-10-2006, 03:04 AM
if you have you combobox equal a textbox so that your values can be stored there: [qutoe]
Private Sub Combo1_Change()
Combo1.Text = txtCombo.Value
End Sub

If txtcombo.value = "the selection you choose" then
TextBox = "the value you want to enter"
End if
[/quote]

I am not sure if this is what you were after or if you meant something else?

dfuas
06-12-2006, 03:33 AM
Thanks all for your help. Thanks to your input I managed to find the solution.

Regards,

dfuas