Only a single record shows in the subform

daleowens1949

New member
Local time
Today, 12:48
Joined
Dec 14, 2024
Messages
2
Make packing ship form
This business is a machine shop. It ships out parts as soon as they are ready which means an order could have more than one invoice due to partial shipments. So, when it's time to make a shipment the owner opens this form (frmMakeShippingLable). He selects the Job Number (Order number in a POS business). After selecting the job number the main form gets populated with data from the order header table the and customer table.
Then he picks a linenumber to add order detail data to the subform. He can add any number of line numbers that are being shipped.
My problem is that, no matter how many line numbers he selects it only shops the last one selected.
CODE HERE:
Private Sub cboLineNumber_AfterUpdate()
Dim sLineNum As String
Dim iPos As Integer
On Local Error GoTo ERR_cboLineNumber_AfterUpdate
sLineNum = cboLineNumber
If RNLen(msLineNumList) = 0 Then GoTo ADD_LINE ' msLineNumList empty
iPos = InStr(1, msLineNumList, sLineNum) ' msLineNumList has line numbers - Don't duplicate
If iPos = 0 Then GoTo ADD_LINE ' Selected line number not added yet
EXIT_cboLineNumber_AfterUpdate:
Exit Sub
ERR_cboLineNumber_AfterUpdate:
Debug.Print Err, Err.Description
ShowError "frmMakeShippingLabel_cboLineNumber_AfterUpdate"
Resume EXIT_cboLineNumber_AfterUpdate

ADD_LINE:
' Add a new line number to the subform
Me!fsubOrderPackingSlip.SetFocus
Me!fsubOrderPackingSlip!LableJobNumber = msJobNum
Me!fsubOrderPackingSlip!lableLineNumber = sLineNum
Me!fsubOrderPackingSlip!LableOrdered = Me.cboLineNumber.Column(1)
Me!fsubOrderPackingSlip!LableSold = Me.cboLineNumber.Column(2)
Me!fsubOrderPackingSlip!LableDue = Me.cboLineNumber.Column(3)
Me!fsubOrderPackingSlip!LableItemNumber = Me.cboLineNumber.Column(4)
Me!fsubOrderPackingSlip!LableDescription = Me.cboLineNumber.Column(5)
Me!fsubOrderPackingSlip!LableShiped = Me.cboLineNumber.Column(6)
DoCmd.RunCommand acCmdSaveRecord
Me.fsubOrderPackingSlip.Requery
End Sub
 
Welcome to Access World! We're so happy to have you join us as a member of our community. As the most active Microsoft Access discussion forum on the internet, with posts dating back more than 20 years, we have a wealth of knowledge and experience to share with you.

We're a friendly and helpful community, so don't hesitate to ask any questions you have or share your own experiences with Access. We're here to support you and help you get the most out of this powerful database program.

To get started, we recommend reading the post linked below. It contains important information for all new users of the forum:

https://www.access-programmers.co.uk/forums/threads/new-member-read-me-first.223250/

We hope you have a great time participating in the discussion and learning from other Access enthusiasts. We look forward to having you around!
 
Why another thead on the same issue? :(
 

Users who are viewing this thread

Back
Top Bottom