Link to home
Start Free TrialLog in
Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScFlag for Zambia

asked on

The idea here is to have the barcode for the point of sales scanned on one control in Ms Access Database

Simple Point Of Sales Logic


The idea here is that the scanner will be pointing to txtProductstsScan control, then once the scan is done then the BARCODE text must be transferred to Description control in the subform which is set to show in column (2) , if this is archived then the whole line will automatically completed.


For example capturing the text below by scanner will result into three lines created in the subform


Training.accdb

6009803227328
6009803227329
6009803227337
 
Must result into three lines created


Dim rst As Object
Set rst = [Form_sfrmInvoicedetails Subform].RecordsetClone
With rst
.AddNew
.Fields("Description") = CStr(Me.txtProductstsScan)
.Update
End With
Me.txtProductstsScan = ""
rst.Close
Set rst = Nothing
[Form_sfrmInvoicedetails Subform].Requery
DoCmd.GoToRecord , , acNewRec

Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Flag of Zambia image

ASKER

After trying all what I can now I'm  almost  able to fix it with the code below but I still have an error which I need your help.

Private Sub CboBarcodes_AfterUpdate()
[Forms]![frmInvoice]![sfrmInvoicedetails Subform].Form.[Product] = Me.CboBarcodes
Me.sfrmInvoicedetails_Subform.SetFocus
Me.[sfrmInvoicedetails_Subform].Requery
DoCmd.GoToRecord , , acNewRec
Me.CboBarcodes = ""
End Sub

Open in new window



ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you so much John for the job well done.

Regards

Chris