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.
tomtom98Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill RossProgrammerCommented:
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
Acronis Data Cloud 7.8 Enhances Cyber Protection

A closer look at five essential enhancements that benefit end-users and help MSPs take their cloud data protection business further.

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 RossProgrammerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.