Solved How to scan a barcode from a parent form and update the child/subform in MS access (2 Viewers)

nector

Member
Local time
Tomorrow, 00:48
Joined
Jan 21, 2020
Messages
548
Instead of the users lookup for the correct product code/barcode from the subform I want the users to simply scan the barcode from the parent form from the control called productcode and once that is done then the after update event fires and update the subform.


Code:
Option Compare Database
Option Explicit
Private Sub Text9_AfterUpdate()
Forms!frmCustomerInvoice![sfrmLineDetails Subform]!ProductCode.Form.Requery
DoCmd.GoToRecord , , acNewRec
End Sub


For example the productcode or barcode = 4100525 once scanned from the parent form it should create a new line in the child form


1758614916481.png
 

Attachments

Last edited:
here test your form.
see the code on the "barcode" (main form) Before and After Update event.
 

Attachments

here test your form.
see the code on the "barcode" (main form) Before and After Update event.
Thank you so much, that is exactly what I was looking for, many thanks also go to other respondents
 
Only issue I've ever had with bar code readers is some don't include a return or CR/LF when scanning. Just something to keep in mind and warn end users during product setup for their scanner.
 
some don't include a return or CR/LF when scanning.
with barcode readers it's very important to have the original documentation because the setup instructions invariably include barcodes that you can scan which set up the barcode scanner so if there's something missing like returning line feed which is important when processing text output -- it could be that someone has altered the settings so find the book and scan the correct barcode to reset the scanner you might be able to find such a book on line if the original is missing
 

Users who are viewing this thread

Back
Top Bottom