• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 483
  • Last Modified:

Automatically Print Barcode on Scan

I would like to create a simple box in access that a user scans a barcode with a scanner gun. Once the label is scanned it automatically sends in to be printed at the printer and is ready to scan the next barcode. My users are tired of scanning and then having to hit a button to send the print job. Our scanners send a CR after each scan so I hope that helps. I am sure that this is very easy, but I can not wrap my mind around it. Thanks.
0
tomtom98
Asked:
tomtom98
  • 3
  • 2
  • 2
1 Solution
 
Bill RossCommented:
Hi tom,

The CR after the barcode triggers the after update event.  Put the print process after the update event.  Assume field tbBarCode and n = minimum barcode length.

pricate sub tbBarcode_after_update
  If len(tbBarcode_after_update) >= n then
   docmd.openreport "BarCodeReport"
  endif
end sub

Regards,

Bill
0
 
tomtom98Author Commented:
That works, but my problem is I only want it to print that particular scanned barcode, it is bring all at once. Thanks.
0
 
Rey Obrero (Capricorn1)Commented:
you need to use a filter when printing the report

private sub txtbox_afterupdate()


me.dirty=false  'save the record

docmd.openreport "BarCodeReport",,,"[recordid]=" & me.recordid


end sub
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Rey Obrero (Capricorn1)Commented:
also, you need to include in your report's record source the field recordid.
0
 
tomtom98Author Commented:
I do not want to store and of the labels. I just want to scan a barcode and it print and ready for the next scan. No storing of the barcodes. Thanks.
0
 
Rey Obrero (Capricorn1)Commented:
so you are saying that what is scanned and displayed in the textbox are not stored in a table?


what is the setting of the textbox "Enter Key behavior" property ? it should be set to "default"


what is the record source of your report?
0
 
Bill RossCommented:
Hi tom,

Describe the report.  As capricorn says you should be able to filter the report.  You will only need to have the barcode on the screen.  If the form is unbound then you can just add the barcode to a blank report and make the recordsource for the barcode on the report refer to the form.

=Forms!yourformname!tbBarcode

That way you are just printing what is on the screen.

Bill
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now