Hi
I want to fill LVe1 (listview) with all the records having customer name as in text box and i have used the following lines, but there is no output instead as soon as i start typing name, existing record disappear which i load at form loading.
I am new to Vb please explain the cause also
Please help to sort out.
Thanks in advance
Private Sub Text1_Change()
Set rsSrch = New ADODB.Recordset
rsSrch.Open "select * from bill_table where customer_name like '*" & frmEdit.Text1.Text & "*'", ConnEdit, adOpenStatic, adLockOptimistic
Lve1.ListItems.Clear
Do Until rsSrch.EOF
Set x = Lve1.ListItems.Add(, , rsSrch.Fields!bill_no)
x.SubItems(1) = Format(rsSrch.Fields!bill_date, "dd-mm-yyyy"
x.SubItems(2) = rsSrch.Fields!customer_name
x.SubItems(3) = rsSrch.Fields!address
rsrsSrch.MoveNext
Loop
End Sub
I want to fill LVe1 (listview) with all the records having customer name as in text box and i have used the following lines, but there is no output instead as soon as i start typing name, existing record disappear which i load at form loading.
I am new to Vb please explain the cause also
Please help to sort out.
Thanks in advance
Private Sub Text1_Change()
Set rsSrch = New ADODB.Recordset
rsSrch.Open "select * from bill_table where customer_name like '*" & frmEdit.Text1.Text & "*'", ConnEdit, adOpenStatic, adLockOptimistic
Lve1.ListItems.Clear
Do Until rsSrch.EOF
Set x = Lve1.ListItems.Add(, , rsSrch.Fields!bill_no)
x.SubItems(1) = Format(rsSrch.Fields!bill_date, "dd-mm-yyyy"
x.SubItems(2) = rsSrch.Fields!customer_name
x.SubItems(3) = rsSrch.Fields!address
rsrsSrch.MoveNext
Loop
End Sub