I am trying to get a report to open with information based on selection on my form, but when I try to set the record source, I get an error that I can't change the recordsource while the report is printing. Can this be done? This is my code that is called in the frmPrintLogs.
?!?!?!?!
Code:
Private Sub cmdPrint_Click()
Dim lstitem As Variant
Set db = CurrentDb
For Each lstitem In Me.lstLog.ItemsSelected
strSQL = "SELECT * FROM tblLogs WHERE LogRef = " & lstLog.Column(0, lstitem)
DoCmd.OpenReport "rptLog", acViewPreview
Reports!rptLog.RecordSource = strSQL
Next
End Sub
?!?!?!?!