leynie Newbie

Joined: August 25 2005 Posts: 1
|
| Posted: August 28 2005 at 9:22am | IP Logged
|
|
|
Hi all,
I am working on a program where once a barcode is scanned the relevant details of the product would be extracted from the database and displayed on the HFG (hierachical flexgrid). The problem is, only one product item data is displayed on the HFG everytime an item is scanned but i wish to keep the previous scanned product data on the HFG when scanning for the second item. Any idea on how i can do it? the following are the code snippet:
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 126 Then
'Reset the KeyAscii to 0
KeyAscii = 0
ScannedData.Text = InputBox("Barcode Read:")
Dim sql As String
sql = "select * from book where barcode like '" & ScannedData.Text & "%'"
adcBook.RecordSource = sql
adcBook.CommandType = adCmdText
adcBook.Refresh
Set grdBook.DataSource = adcBook
End If
End Sub
Would appreciate as well if anyone could tell me if i am doing it correctly or how i could improve on it.
Thanks in advance!
cheers,
leynie
|