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