I am trying to create a process that allows the user to send a report to disk. I created the check box and everything. I was able to get the report to disk but without any filter. I did some search and looked at sample code and tried this code:
' check to see if there is any data before creating reports
If CheckData("Peer Review") Then
stDocName = "Peer Review Report"
If Me.Print_Option = 1 Then
DoCmd.OpenReport stDocName, acNormal, , StLinkCriteria
Else
If Me.Print_Option = 2 Then
DoCmd.OpenReport stDocName, acViewPreview, , StLinkCriteria
Else
Set rptReport = New stDocName
rptReport.Filter = StLinkCriteria
rptReport.FilterOn = True
DoCmd.OutputTo acOutputReport, rptReport, acFormatRTF, , True
End If
End If
Else
End If
But I get an error message saying set command saying 'User defined type not defined'. Obviously I am screwing up something in this. Could you please explain what I am missing here or if there is a better way to do an OutputTo with filters.
Thanks again
' check to see if there is any data before creating reports
If CheckData("Peer Review") Then
stDocName = "Peer Review Report"
If Me.Print_Option = 1 Then
DoCmd.OpenReport stDocName, acNormal, , StLinkCriteria
Else
If Me.Print_Option = 2 Then
DoCmd.OpenReport stDocName, acViewPreview, , StLinkCriteria
Else
Set rptReport = New stDocName
rptReport.Filter = StLinkCriteria
rptReport.FilterOn = True
DoCmd.OutputTo acOutputReport, rptReport, acFormatRTF, , True
End If
End If
Else
End If
But I get an error message saying set command saying 'User defined type not defined'. Obviously I am screwing up something in this. Could you please explain what I am missing here or if there is a better way to do an OutputTo with filters.
Thanks again