hey,
why isn't this working? i can't seem to figure it out. it's reporting rep as null :S
thanks
Martin
why isn't this working? i can't seem to figure it out. it's reporting rep as null :S
Code:
Private Sub cmdReport_Click()
'loads report for the selected party
Dim checkReport As Boolean
Dim rep As Report
Dim reportname As String
checkReport = False
Set db = CurrentDb
reportname = "rpt_" & partyNames & ""
For Each rep In Reports
If rep.Name = reportname Then
checkReport = True
Exit For
End If
Next
If checkReport = True Then
DoCmd.OpenReport reportname, acViewPreview
Else
DoCmd.CopyObject , reportname, acReport, "rpt_template"
DoCmd.OpenReport reportname, acViewDesign
Reports(reportname).RecordSource = "tbl_" & partyNames & "_reviewed"
Reports(reportname).Controls.Item("label32").Caption = "Report On " & partyNames
End If
End Sub
thanks

Martin