Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dependent Record Source on Subreport

Status
Not open for further replies.

IcePak

Technical User
Nov 7, 2001
23
0
0
US
Hi,

I have a report that has a subreport in it. The report displays a picture and one row of data. The subreport in the report will display information from a table depending on the content of one of the cells in the row of data displayed.

Is there any way to have the record source of the subreport call out data from a table where the table name is obtained from referencing a cell from a row of data?

Something along the lines of how queries call out form variables
[Form]![Test]![VARIABLE]

I tried doing something like SELECT DISTINCTROW [[Form]![Test]![VARIABLE]]

Any help would be grand

-mike
 
What happened when you put as RecordSource in your subreport something like:

SELECT * FROM Forms![Test].[VARIABLE]

where VARIABLE contains the name of the table the subreport is based on?
 
Hi,
I just tried it. It comes up with a syntax error for the FROM statement.
Then I tried to just put

[Forms]![Test].[VARIABLE]

and it actually looks for a table called "[Forms]![Test].[VARIABLE]"

any suggestions?
 
Probably you could know try to set the value of the RecordSource attribute.
Try to set the value in the Open event procedure of the subreport:

Me.RecordSource=[Forms]![Test].[VARIABLE]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top