Changing the source of a report

  • Thread starter Thread starter Lisa R
  • Start date Start date
L

Lisa R

If I have generated a report with a given table or querry and I want to keep
the format, but change the source (table or querry), how do I do that?
 
Assuming the form (or report) is open, you can use

Forms![NameOfForm].RecordSource = "NewQueryName"

or

Reports![NameOfReport].RecordSource = "NewQueryName"
 
If I have generated a report with a given table or querry and I want to keep
the format, but change the source (table or querry), how do I do that?

Open the report in design view. View its Properties; on the Data tab the first
row is the Recordsource property.

This will be either the name of your table or query, or a SQL string (a local
query, basically).

Replace it with your other query name.

If you need to do this routinely, you should ask why you need different
queries for (apparently) the same kind of data - might a single Parameter
query letting you dynamically change the criteria for the query be an
alternative?

John W. Vinson [MVP]
 
What if nothing shows up on the DATA tab?

Are you looking at the properties of the Report itself? Or the Detail or some
other section? Be sure to get the right properties: right mouseclick the
little square at the upper left intersection of the rulers in design view and
select Properties.

If you are, and there is a blank next to Recordsource, then your report is
unbound and won't display any data (there's no data to display). You can set
the property to the name of a query to display data from that query.

John W. Vinson [MVP]
 
Back
Top