R
rob
All,
Quick question....
I'm trying to filter out a report to just give me one record...
I'm testing my code using a command button. When I press the button, the
report still gives me every record. What am I doing wrong?
Private Sub Command0_Click()
Dim EPR
EPR = CStr(95) '95 is the PKID of the coversheets underlying
query/table
msgResponse = MsgBox("Print an EPR Coversheet?" & vbCrLf & vbCrLf & " ",
vbYesNo, "EPR Coversheet")
If msgResponse = 6 Then
Print_Cover_Sheet (EPR)
End If
End Sub
Function Print_Cover_Sheet(x As String)
On Error GoTo Err_Print_Cover_Sheet
Dim stDocName2 As String
stDocName2 = "rptCoverSheet2"
DoCmd.OpenReport stDocName2, acPreview, "tblEPR.PKID =" + x
Exit_Print_Cover_Sheet:
Exit Function
Err_Print_Cover_Sheet:
MsgBox Err.Description
Resume Exit_Print_Cover_Sheet
End Function
Quick question....
I'm trying to filter out a report to just give me one record...
I'm testing my code using a command button. When I press the button, the
report still gives me every record. What am I doing wrong?
Private Sub Command0_Click()
Dim EPR
EPR = CStr(95) '95 is the PKID of the coversheets underlying
query/table
msgResponse = MsgBox("Print an EPR Coversheet?" & vbCrLf & vbCrLf & " ",
vbYesNo, "EPR Coversheet")
If msgResponse = 6 Then
Print_Cover_Sheet (EPR)
End If
End Sub
Function Print_Cover_Sheet(x As String)
On Error GoTo Err_Print_Cover_Sheet
Dim stDocName2 As String
stDocName2 = "rptCoverSheet2"
DoCmd.OpenReport stDocName2, acPreview, "tblEPR.PKID =" + x
Exit_Print_Cover_Sheet:
Exit Function
Err_Print_Cover_Sheet:
MsgBox Err.Description
Resume Exit_Print_Cover_Sheet
End Function