Subreport For Multiple Users

lhooker

Registered User.
Local time
Today, 17:58
Joined
Dec 30, 2005
Messages
431
I have a report (main report) that has three (3) subreports. Each subreport has it's own query that produces data for each subreport. I'm trying to use the query from each subreport for several users. For example, user1's user2's user3's, and user4's would have their information on the main report along with data from the three (3) subreports. My problem is that I would have create a main report, subreports, and queries for each user. This is definitely not the best way to do this. I create a query that combines the data from the queries for the subreport, but can't figure out how to use it with the subreports from the main report. I looked into using 'Link Child Fields' and 'Link Master Fields', did not get the expected results. I'm able to add the user name for user1's . . . user4's query as a criteria and get the results needed, but that I would do the same for each user. What is the best way to do this ? Thanks ! ! !
 
Let's just work with one subreport and one user. Ideally your subreport will contain data in a User field which has the name of the person able to see that line of data. So when you run it before managing to achieve your goal it will simply show all the data for Tom, Dick, and Harry.

I usually ensure I include this field in my subreport and then make it invisible. Do that first and later take it out if you want and see if it was necessary.

Anyway, the trick is to link this field in the Child report with the main report. If your main report also has the User field in its data, then you can do the same thing. Ensure it shows on the report and make it invisible. Then set the fields you described to be the same. Try to ensure the controls have the name of the field as their names as well.

So on your main report you have a control called User linked to the field User, and the same on your subreport. In the subreport control set those LinkMaster and LinkChild to User and User, and it should work.

If this isn't the situation then let me know.

Sam.
 
Sam,

That worked . . . Thanks ! ! ! :D
 
Glad it worked and thanks for the reply. Getting bored of writing up solutions here and never hearing whether it was useful. Or even read for that matter.
 

Users who are viewing this thread

Back
Top Bottom