Hello All, I am setting up a report that will allow me to print a certain number of labels of our customers. i first have a table called [CUSTOMER ADDRESS]. In this table, i have the fields "Customer Name" "Address Line 2" "Address Line 3" "City" "State" "Zip Code" and "Customer number" (which is an autonumber). In a seperate table called [CUSTOMER ADDRESS TABLE] I have the fields "Customer Name" & "TXTCopies" . In a querey [CUSTOMER ADDRESS TABLE QUEREY] i have the 2 tables, joined by "Customer Name" I select the customer i want in a form [CUSTOMER ADDRESS TABLE]. I then print the report by a macro which opens the [CUSTOMER ADDRESS TABLE] then prints the report, then runs a delete querey to erase the address you just printed (this allows the next user to select a customer from the form without having the customer printed still there). The report has an event procedure that on print shows:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If [Forms]![Customer Address Table]![txtcopies] = 0 Or IsNull([Forms]![Customer Address Table]![txtcopies]) Then
Me.NextRecord = True
Me.MoveLayout = False
Me.PrintSection = False
Else
If PrintCount < [Forms]![Customer Address Table]![txtcopies] Then
Me.NextRecord = False
End If
End If
End Sub
After all that explaining, my problem is as follows. We have several customers with several different ship to locations. so the Customer Name is the same, but the rest of the address is different. If i select a customer from the list that has multiple locations, the report prints all the locations. If i select a customer with just one locaton, it only prints the number of labels i asked for.
Any help would be greatly appreciated!
Thanks,
Gus
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
If [Forms]![Customer Address Table]![txtcopies] = 0 Or IsNull([Forms]![Customer Address Table]![txtcopies]) Then
Me.NextRecord = True
Me.MoveLayout = False
Me.PrintSection = False
Else
If PrintCount < [Forms]![Customer Address Table]![txtcopies] Then
Me.NextRecord = False
End If
End If
End Sub
After all that explaining, my problem is as follows. We have several customers with several different ship to locations. so the Customer Name is the same, but the rest of the address is different. If i select a customer from the list that has multiple locations, the report prints all the locations. If i select a customer with just one locaton, it only prints the number of labels i asked for.
Any help would be greatly appreciated!
Thanks,
Gus