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