Print a record multiple times based a value in a Table

agb136

New Member
Joined
Jan 26, 2006
Messages
34
Hi,

I am pretty new to Access and I am having some trouble. I have a table that contains the following columns: ID Number, City, State, and Number of Copies Needed. I want to be able to filter by State, then print all the records including copies of the records based on Number of Copies Needed column.

I have the first part down I am using a combo box on a form and the following code to filter:

Private Sub Cell_AfterUpdate()

If IsNull(Me.State) Then
Me.FilterOn = False
Else
Me.Filter = "State = """ & Me.State & """"
Me.FilterOn = True
End If
End Sub

Then I have print command button with this code that prints one of each record:

Private Sub PrintState_Click()
On Error GoTo Err_PrintState_Click

Dim stDocName As String

stDocName = "Labels"
DoCmd.OpenReport stDocName, acNormal, , Forms!StatePrint.Filter

Exit_PrintState_Click:
Exit Sub

Err_PrintState_Click:
MsgBox Err.Description
Resume Exit_PrintState_Click

End Sub


I am stumped on how to print copies of each record. Where do I put the code to make this work (In my PrintState report or In my PrintState command button) and what code can I use?

Thanks for any help you can give me!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,221,707
Messages
6,161,416
Members
451,705
Latest member
Priti_190

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top