I am trying to get the create report method to work but so far i have had little luck.
here is what i have so far:
Private Sub Form_Close()
Dim rpt as report
set rpt = CreateReport( , Proj_Temp)
strSQL = "SELECT item_num, name, quantity FROM Project"
DoCmd.Openreport Proj_Temp, acViewPreview
Reports!Proj_Temp.RecordSource = strSQL
End Sub
It is ran when i close a form. I want it to create a report based on the report template that i have created (Proj_Temp). So far it creates a blank empty report. I need it to open the template report and set the recordsource.
It is also giving me a run-time error 2497 "action or method requires a report name arguement" and it highlights the docmd.openreport part of the code above.
I may have some things not in the right place. I would appreciate any suggestions.
cdw
here is what i have so far:
Private Sub Form_Close()
Dim rpt as report
set rpt = CreateReport( , Proj_Temp)
strSQL = "SELECT item_num, name, quantity FROM Project"
DoCmd.Openreport Proj_Temp, acViewPreview
Reports!Proj_Temp.RecordSource = strSQL
End Sub
It is ran when i close a form. I want it to create a report based on the report template that i have created (Proj_Temp). So far it creates a blank empty report. I need it to open the template report and set the recordsource.
It is also giving me a run-time error 2497 "action or method requires a report name arguement" and it highlights the docmd.openreport part of the code above.
I may have some things not in the right place. I would appreciate any suggestions.
cdw