report record source

  • Thread starter Thread starter thriveni
  • Start date Start date
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.
 
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
 
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
.
 
Back
Top