im using vb,recordset(ado)
Q1: i have a listbox(lstData) with rows of items listed. i would like to click on one row and wish that the selected item would b display on a textbox(txtCode) . my prob is i can only select the first item from the table.anyone know wut's wrong?here's my coding:
Private Sub lstData_DblClick()
Dim rs As New ADODB.Recordset, sql As String
sql = "SELECT prodID,prodDesc,prodPrice" _
& " FROM menu "
rs.Open sql, sConn1, adOpenKeyset, adLockOptimistic, adCmdText
Let txtCode.Text = rs(lstData.ItemData(lstData.ListIndex))
Let txtDesc.Text = rs.Fields("prodDesc")
Let txtPrice.Text = rs.Fields("prodPrice")
Q2: when i enter the user id, i click on a search button. then the entire user particular should be displayed. how to perform this? i hav to match with my table's collection right?
i would like to thanks in advance to anyone who offer me a help..