send scanned data to a table

J

JIM.H.

Hello,
I have a text box and I let user scan barcodes into this
text box. I have after update trigger on it and once the
user press enter it send this barcode to a table. I am
wondering if I can get it done without pressing enter key,
once user scans a barcode, I want to send it to a table
directly without the obligation of pressing enter. From
time to time, the user may need to type barcode digits
into the text box, so it should work for both typing and
scanning. How can I do that?
Thanks,
Jim.
 
N

Norman Yuan

It depends upon how the data gets to the form from barcode scanner. There
must be some code reading the output from the scanner and display them on
the form. Thta is where you add/modify the code to do what you want.

Current process may be:

1. scan barcode and output to computer.
2. your program read scanner output data
3. display on form
4. user confirm data by hitting a button to insert a record to data table
(may be update a record in data table)


You want to:

1. scan barcode and output to computer.
2. your program read scanner output data
3. insert a record to data table (may be update a record in data table), and
data also displayed on form, so that user can enter changes/new barcode,
then save to data table.

So, you see, you basically only need to put the same (or almost the same)
code underneath the "Save" button) right after the spot where your app gets
data from scanner's output. Of course you still want the code underneath
"Save" button working.
 
J

JIM.H.

I have a form and the scanner reads the barcode and put it
in a text box in the form. there is after update trigger
on the text box, when user presses enter I take the data
from this field and put it into a table. After update
trigger does not launch until user typed enter. Is there
anyway I can launch my code just after barcode is scanned
to this text box.
 
C

Chris Howarth

JIM.H. said:
I have a form and the scanner reads the barcode and put it
in a text box in the form. there is after update trigger
on the text box, when user presses enter I take the data
from this field and put it into a table. After update
trigger does not launch until user typed enter. Is there
anyway I can launch my code just after barcode is scanned
to this text box.

Is the string created by the scanning always the same length?

You could put code in the textbox_change event to force a save when the
entered string length is equal to the expected length.

eg

Private Sub Text0_Change()

Dim intExpectedLength As Integer

intExpectedLength = 8 'Change to suit your requirements

If Len(Text0.Text) = intExpectedLength Then
'Insert Save routine here or call cmdSave_Click event
End If

End Sub

The disadvantage is during manual entry when the save routine would be
called as soon as the specified length has been reached meaning that
correction, if necessary, would not be allowed before a save.

Hopefully this is a starting point.

Chris
 
J

JIM.H.

Thanks chris,
what is the difference between Text0.Text and Text0.Value.
When I use Text0.Value in the len(), it says null, I need
value.
Thanks,
Jim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top