Is there an easy way to copy the entire layout of a
report, but switch the source from one query to another?
I have many similiar reports to create that show the same
information, but different records (Based on filters in
the query). The queries are the exact same except for
some of the criteria.
Thanks in Aadvance!
Parker
1) To copy a report, right-click on the report name in the Access main
folder.
Select Copy.
Move the cursor to a blank portion of the folder.
Click Paste.
Give the new report a new name.
Open the report in design view.
Delete the old RecordSource property and enter the name of the new
recordsource.
2) Or ... Simply use one report, and filter the data, using an Option
Group on the form, using a where clause argument of the OpenReport
method?
If Me!OptionGroupName = 1 Then
DoCmd.OpenReport "ReportName",acViewPreview, ,"[City] = " & Me![City]
& "'"
ElseIf Me!OptionGroupName = 2 then
DoCmd.OpenReport "ReportName",acViewPreview, ,"[State] = " &
Me![State] & "'"
Else
DoCmd.OpenReport "ReportName",acViewPreview, ,"[Country] = " &
Me![Country] & "'"
3) Or ... Use the Filter argument in the OpenReport method:
DoCmd.OpenReport "ReportName",acViewPreview,"QueryName"
4) Or... Simply leave the record source blank and assign the
recordsource query to the report in the report Open event usiong an
Option Group for example on a form.
If forms!FormName!OptionGroupName = 1 Then
Me.RecordSource = "Query1"
ElseIf forms!FormName!OptionGroupName = 2 Then
Me.RecordSource = "Query2"
Else
Me.RecordSource = "Query3"
End If
Using method's #2, 3 and 4 you have only one report to maintain,
instead of several.