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

nector

Member
Local time
Today, 13:21
Joined
Jan 21, 2020
Messages
599
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.
 

Users who are viewing this thread

Back
Top Bottom