Hello,
Please can anyone suggest me code to change the color of textbox at runtime in VB?
Please can anyone suggest me code to change the color of textbox at runtime in VB?
Private Sub cboMode_DropDown()
Dim sSql As String
Dim Rsdata As New ADODB.Recordset
sSql = ""
sSql = "Select CompID , CompName From Company"
Rsdata.Open sSql, c_Cnn, adOpenForwardOnly, adLockReadOnly
cboMode.Clear
While Not (Rsdata.EOF Or Rsdata.BOF)
cboMode.AddItem Rsdata!CompName & ""
cboMode.ItemData(cboMode.NewIndex) = Rsdata!CompID & ""
Rsdata.MoveNext
Wend
Set Rsdata = Nothing
End Sub
on change event of combo write
Dim sSql As String
Dim Rsdata As New ADODB.Recordset
ssql=select * from table where compid=" & Val(cbomode.ItemData(cbomode.ListIndex))
' write the code here
Comment