report record source

T

thriveni

I use access 2000.
I have a report that has the same layout for 3 different
tables. Can I use the same report for the 3 tables with a
front end form from which I select which report I need.
How do I specify the record source for the report in such
a case ? any help will be appreciated.
 
J

Jim/Chris

I got this from one of the extremely smart MVP's(FRED)

You can also use just one report for both tables, by simply
deleting the recordsource and leaving it blank.
Then code the Report Open event to set it's recordsource
there, according to a user selected value on a form:
If forms!FormName!OptionGroupName = 1 Then
Me.RecordSource = "Table1"
Else
Me.RecordSource = "Table2"
End If
The form would have to be open when the report is run.

Jim
 
G

Guest

thanku. that works great !
-----Original Message-----
I got this from one of the extremely smart MVP's(FRED)

You can also use just one report for both tables, by simply
deleting the recordsource and leaving it blank.
Then code the Report Open event to set it's recordsource
there, according to a user selected value on a form:
If forms!FormName!OptionGroupName = 1 Then
Me.RecordSource = "Table1"
Else
Me.RecordSource = "Table2"
End If
The form would have to be open when the report is run.

Jim
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top