Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

VB6 po,,,,,,sana mabigyan nyo po ako ng advise...

mikim

Novice
Advanced Member
Messages
23
Reaction score
0
Points
26
Guys may tanong ako regarding sa search,,,pag kasi ako nagasearch using barcode scanner in vb6,tapos yung na search ko ay wala dun sa list,,,,,,,,,ang nangyayari ay paulit ulit na nalabas ang 'No Item found!' kung gano kadami yung letter o number sa Productcode.text ganun kadaming beses lumalabas yung "No Item found" kaya ang nangyayari madaming beses ako naga OK dun sa Msgbox na "No Item found" ,,,,,,,,nagtataka ako kasi after nung naman nung Msgbox ko,,,naglagay me ng Exit sub,,,,pero pagdating dun ganun padin,,,,nalabas padin sya,para kasi syang nagloloop.....




Ano po kaya ang solution para dito,,,,,Madaming salamat po sa inyong lahat,

Eto po ang code ko :)




Set Connect = New Class1
Set rx = New ADODB.Recordset

With rx
rx.Open "Select * from Inventory where Productcode like '" & Productcode.text & "'", con, 3, 3
If rx.RecordCount >= 1 Then
ListView1.ListItems.Clear
Do While Not .EOF
ListView1.ListItems.Add , , !ID, 1, 1
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(1) = "" & !Productcode
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(2) = "" & !CustomerID
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(3) = "" & !Customername
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(4) = "" & !Customerlastname
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(5) = "" & !Totalamount
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(6) = "" & !Tendered
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(7) = "" & !Balance
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(8) = "" & !Duedate
rx.MoveNext
Loop
.Close
Else
Msgbox"No Item found!"
exit sub
End If
End With
Set rx = Nothing
con.Close: Set con = Nothing
 
Last edited:
Sir pag bili ng barcode scanner my cd po yan need to install dpt meon ka noon idol.
 
for search statement, always use '%' symbol
exe: select * from Inventory where ProdCode like '%" & SuperTextbox.Text & "%',con,3,3
 
Last edited:
sang event b nakalagay yung code mo sir? sa change ba or sa keydown?

try mo sa keydown elagay ang code sir

ganito

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Set Connect = New Class1
Set rx = New ADODB.Recordset

With rx
rx.Open "Select * from Inventory where Productcode like '" & Productcode.Text & "'", con, 3, 3
If rx.RecordCount >= 1 Then
ListView1.ListItems.Clear
Do While Not .EOF
ListView1.ListItems.Add , , !ID, 1, 1
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(1) = "" & !Productcode
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(2) = "" & !CustomerID
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(3) = "" & !Customername
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(4) = "" & !Customerlastname
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(5) = "" & !Totalamount
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(6) = "" & !Tendered
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(7) = "" & !Balance
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(8) = "" & !Duedate
rx.MoveNext
Loop
.Close
Else
MsgBox "No Item found!"
Exit Sub
End If
End With
Set rx = Nothing
con.Close: Set con = Nothing
End If

End Sub
 
Last edited:
sang event b nakalagay yung code mo sir? sa change ba or sa keydown?

try mo sa keydown elagay ang code sir

ganito

Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyReturn Then
Set Connect = New Class1
Set rx = New ADODB.Recordset

With rx
rx.Open "Select * from Inventory where Productcode like '" & Productcode.Text & "'", con, 3, 3
If rx.RecordCount >= 1 Then
ListView1.ListItems.Clear
Do While Not .EOF
ListView1.ListItems.Add , , !ID, 1, 1
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(1) = "" & !Productcode
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(2) = "" & !CustomerID
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(3) = "" & !Customername
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(4) = "" & !Customerlastname
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(5) = "" & !Totalamount
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(6) = "" & !Tendered
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(7) = "" & !Balance
ListView1.ListItems(ListView1.ListItems.Count).Sub Items(8) = "" & !Duedate
rx.MoveNext
Loop
.Close
Else
MsgBox "No Item found!"
Exit Sub
End If
End With
Set rx = Nothing
con.Close: Set con = Nothing
End If

End Sub




sir sa change event po ako naglagay
 
Back
Top Bottom