Results 1 to 3 of 3

Thread: listbox

  1. #1
    Join Date
    Sep 2002


    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")
    end sub

    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..

  2. #2
    Join Date
    Feb 2002
    What is the relationship between the list box entries and the recordset ?

    Please be more specific. What will be displayed when you click search ?

  3. #3
    Join Date
    Sep 2002


    thank you, rnealejr.i've solve the problem already.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts