my function same like u,but why my textbox can't display data..
my entire coding is like that:
Private Sub cboItem_LostFocus()
Dim rst As New ADODB.Recordset
Dim sql As String
sql = "select ItemID,ItemName from Item where ItemID='" & Val(cboItem.Text) & "'"
rst.Open sql, conn
If Not rst.EOF Then
Text1.Text = rst("ItemName")
Else
Text1.Text = ""
End If
rst.Close
Set rst = Nothing
End Sub
Private Sub form_Load()
cboItem.AddItem "C1", 0
cboItem.AddItem "M1"
connect
End Sub
plzz help me....