K
Kelvin
I'm trying to print a report based on the corrent record in the form.
I'm sure I've used this code before, but this time it seems to be acting
different then usual.
I don't get an error message, but it pops up a box with the "SlsId" above a
box when, if I type in the SlsID that's displayed, I get the proper data on
the report.
I have no idea why it pops up the dialog box, prompting me to enter the
SlsId...
Any help would be appreciated.
Kelvin
+++++++++++++++++++++++++++++++++++++
Private Sub PrintReport_Click()
On Error GoTo Err_PrintReport_Click
Dim stDocName As String
Dim strWhere As String
stDocName = "rpt_CommentReport"
strWhere = "[SlsId] = " & Me.[SlsId]
DoCmd.OpenReport stDocName, acPreview, "", strWhere
Exit_PrintReport_Click:
Exit Sub
Err_PrintReport_Click:
MsgBox Err.Description
Resume Exit_PrintReport_Click
End Sub
+++++++++++++++++++++++++++++++++++++
I'm sure I've used this code before, but this time it seems to be acting
different then usual.
I don't get an error message, but it pops up a box with the "SlsId" above a
box when, if I type in the SlsID that's displayed, I get the proper data on
the report.
I have no idea why it pops up the dialog box, prompting me to enter the
SlsId...
Any help would be appreciated.
Kelvin
+++++++++++++++++++++++++++++++++++++
Private Sub PrintReport_Click()
On Error GoTo Err_PrintReport_Click
Dim stDocName As String
Dim strWhere As String
stDocName = "rpt_CommentReport"
strWhere = "[SlsId] = " & Me.[SlsId]
DoCmd.OpenReport stDocName, acPreview, "", strWhere
Exit_PrintReport_Click:
Exit Sub
Err_PrintReport_Click:
MsgBox Err.Description
Resume Exit_PrintReport_Click
End Sub
+++++++++++++++++++++++++++++++++++++