Dynamic Reports

bkessinger
StarLounger
Posts: 71
Joined: 27 Aug 2010, 09:13

Dynamic Reports

Post by bkessinger »

Good Morning all:

Is it possible to create a report that can have multiple (not at the same time) data sources? I would like to have the report select the data source from a dynamic list box of inputs. Any and all suggestions would be appreciated and most helpful. TIA.

Bill K.

User avatar
HansV
Administrator
Posts: 78487
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Dynamic Reports

Post by HansV »

As long as the data sources have the same field names, that should be possible: you can set the Record Source of a report in its On Open event, like this:

Code: Select all

Private Sub Report_Open(Cancel As Integer)
  Me.RecordSource = Forms!frmSelect!lbxDataSources
End Sub
where frmSelect is a form and lbxDataSources a list box on that form listing the names of the data sources.
Best wishes,
Hans

JohnH
3StarLounger
Posts: 287
Joined: 09 Mar 2010, 23:16
Location: Canberra Australia

Re: Dynamic Reports

Post by JohnH »

As long as the data sources have the same field names
Or as in the example of Dynamic Cross tab reports the Control Source of individual controls on the report is set when the report is opened.
Regards

John

bkessinger
StarLounger
Posts: 71
Joined: 27 Aug 2010, 09:13

Re: Dynamic Reports

Post by bkessinger »

Hey John,

Thanks for the reply. I think I found what I need on Roger Carlson's web site. He's got a few excellent examples.

Bill K.

User avatar
HansV
Administrator
Posts: 78487
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Dynamic Reports

Post by HansV »

Yes, Roger's Access Library has many useful sample databases.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15621
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Dynamic Reports

Post by ChrisGreaves »

HansV wrote:... you can set the Record Source of a report in its On Open event, ...
Oh great. Just Great.
Now you guys have started to anticipate my Access questions ..... :grin: and :thankyou:
There's nothing heavier than an empty water bottle

User avatar
Wendell
4StarLounger
Posts: 482
Joined: 24 Jan 2010, 15:02
Location: Colorado, USA

Re: Dynamic Reports

Post by Wendell »

That's because we've already asked the same question and :bash: our head against the wall, or asked somebody till we figured out the answer - most of the time hopefully.
Wendell
You can't see the view if you don't climb the mountain!