Change the combo box value according to the value in a textbox on the same form

F

FA

Can anyone help me with How to Change the Combo Box Value according to
a value in other text box. i have the following code in my Form Load
Event but its not working
I want to change or insert the value in the combo box name combo8
according to the value in the textbox called STD_RSK. So for example if
the value in STD_RSK text box is High, i want the combobox to show the
itemdata 3.

Private Sub Form_Load()
Select Case Me.STD_RSK.Value
Case Is = "High"
Me.Combo8.Value = Me.Combo8.ItemData(3)
Case Is = "Medium"
Me.Combo8.Value = Me.Combo8.ItemData(2)
Case Is = "Low"
Me.Combo8.Value = Me.Combo8.ItemData(3)
Case Else
' Without this: if the textbox has none of the expected valuesb
above,
' the backcolor would remain the same as whatever it was last
set to.
'Me.FINDG_RSK_LVL.BackColor = 16777215
End Select

End Sub
 
F

FA

Hi again, I have the following code working fine in my form Load event

If Me.STD_RSK.Value = "High" Then
Me.FINDG_RSK_LVL_ID.Value = Me.Combo8.ItemData(3)
End If
If Me.STD_RSK.Value = "Medium" Then
Me.FINDG_RSK_LVL_ID.Value = Me.Combo8.ItemData(2)
End If
If Me.STD_RSK.Value = "Low" Then
Me.FINDG_RSK_LVL_ID.Value = Me.Combo8.ItemData(1)
End If
But now i have one more problem, on the form there is another combo box
and if you select something in that combo box, it changes the value in
all other controls acording to the selection, but the Combo8 is not
included in that change, can it be possible that if the user select
something in that combo box and when everything else changes
accordingly, Combo8 also change according to textbox value STD_RSK.
Because STD_RSK value change everything the user select a different
record from the combo box.
Please help me.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top