J
jamccarley
I created a data base that will eliminate a 3page carbon paper, but we still
need three different printouts to go out on the floor on the machines. I
wrote code that prints the same report three time, changing the backgound
color on each printout. It works, but the problem I am having is it only
prints the first record in the table. I want it to print the record that was
just entered. My command button is named "Command590" , the report is "White
Copy" and my number field is "Control_number". Here is the code I have so far.
Form code
Private Sub Command590_Click()
Dim S As String
S = "Control_number" & Me.Label509
Call DoCmd.OpenReport("White Copy", acViewNormal, , S, acWindowNormal, 1)
Call DoCmd.OpenReport("White Copy", acViewNormal, , S, acWindowNormal, 2)
Call DoCmd.OpenReport("White Copy", acViewNormal, , S, acWindowNormal, 3)
End Sub
and the Report code is
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.FillStyle = 0
Select Case Me.OpenArgs
Case 1
Me.Detail.BackColor = vbWhite
Case 2
Me.Detail.BackColor = vbMagenta
Case 3
Me.Detail.BackColor = vbYellow
End Select
End Sub
Thanks
need three different printouts to go out on the floor on the machines. I
wrote code that prints the same report three time, changing the backgound
color on each printout. It works, but the problem I am having is it only
prints the first record in the table. I want it to print the record that was
just entered. My command button is named "Command590" , the report is "White
Copy" and my number field is "Control_number". Here is the code I have so far.
Form code
Private Sub Command590_Click()
Dim S As String
S = "Control_number" & Me.Label509
Call DoCmd.OpenReport("White Copy", acViewNormal, , S, acWindowNormal, 1)
Call DoCmd.OpenReport("White Copy", acViewNormal, , S, acWindowNormal, 2)
Call DoCmd.OpenReport("White Copy", acViewNormal, , S, acWindowNormal, 3)
End Sub
and the Report code is
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.FillStyle = 0
Select Case Me.OpenArgs
Case 1
Me.Detail.BackColor = vbWhite
Case 2
Me.Detail.BackColor = vbMagenta
Case 3
Me.Detail.BackColor = vbYellow
End Select
End Sub
Thanks