I am working with VB6 and Access. There is a SQL query I have written to retrieve a few records. But when I try to display these records in a listbox, only the first one is fetched, others are not. What should I do to fetch all??
[CODE=vb]
Call Connection
Set inv = New ADODB.Recordset
inv.Open "SELECT * FROM Invoice_Trans WHERE Inv_No=" & Val(txtInvNo.Te xt) & "", con, 3, 3
lstSrno.AddItem (inv!SrNo)
lstProd.AddItem (inv!Prod_Code)
lstQty.AddItem (inv!Qty)
lstAmt.AddItem (inv!amount)
rs.Close
[/CODE]
[CODE=vb]
Call Connection
Set inv = New ADODB.Recordset
inv.Open "SELECT * FROM Invoice_Trans WHERE Inv_No=" & Val(txtInvNo.Te xt) & "", con, 3, 3
lstSrno.AddItem (inv!SrNo)
lstProd.AddItem (inv!Prod_Code)
lstQty.AddItem (inv!Qty)
lstAmt.AddItem (inv!amount)
rs.Close
[/CODE]
Comment