Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 31st, 2005, 01:14 PM
stormcandi stormcandi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 6 stormcandi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 20 m 14 sec
Reputation Power: 0
Question Linking subreports and reports

I have a main report in which I also have a subreport. The problem is, is that I have a query that the report is based on. The query requires a parameter (Month & Year) that the user inputs when the report is generated. The subreport also uses this same parameter. I have the child and master fields linked to the query field but when the report is run, it asks for the parameter 6 times before showing the report. How can I set it up so that the parameter is only requested once and then passed to the subreport?

Thanks in advance!

Reply With Quote
  #2  
Old June 3rd, 2005, 07:28 AM
sherrington sherrington is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 85 sherrington User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 4 m 52 sec
Reputation Power: 5
Queries in sub reports

It may be simpler to create a form which prompts for the variables. Then change the queries to refer to the form. The form then has a button which prints the report

Reply With Quote
  #3  
Old June 5th, 2005, 04:15 PM
stormcandi stormcandi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 6 stormcandi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 20 m 14 sec
Reputation Power: 0
Unhappy

But if I have the Child/Master Links in there shouldn't it be working right? I don't really want to do a form since the user has to do a few inputs already. If I did the form, how would I save the value until the user changes it in the form again?
The input fields are in the base queries, so to make any changes in them would cause major rework. If I put the field on the report and had the second query reference that field (whose value is determined by the user input in the first query), would that work. I am not even sure of how to go about either of these options, since I am very new at VBA and stuff.

Reply With Quote
  #4  
Old June 6th, 2005, 02:33 AM
sherrington sherrington is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 85 sherrington User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 4 m 52 sec
Reputation Power: 5
Assuming that the Parent/Child links will imit the data in the subreport - do you really need parameters in the subreport query?

Reply With Quote
  #5  
Old June 6th, 2005, 07:40 AM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Set your subreport record source to the underlying table from the parameter query, not the query itself. If the Parent/Child links are set correctly, you will only be prompted for the parameter for the main report and the subreport will only show records filtered by the main report.

lwells

Reply With Quote
  #6  
Old June 6th, 2005, 01:33 PM
stormcandi stormcandi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 6 stormcandi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 20 m 14 sec
Reputation Power: 0
Unhappy

I have done what you said however, all values in the underlying table are coming in. I only want the row that matches the parameter passed by the main report's query. I am also trying to see how I can get the subreport to total what is shown in the main report. More help, please?! I am new to adding subreports to a report and need some hand holding. I REALLY appreciate it!

Reply With Quote
  #7  
Old June 6th, 2005, 03:25 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
How is your main report linked with the subreport. Typically the subreport will display all records related to the main report. Example would be a supplier displaying all products that the supplier handles. So the main report would show the supplier information and the subreport would display all the products for that supplier. The subreport would be linked to the main report supplier id. Perhaps you can share with us how your tables and relationships are set up.

Reply With Quote
  #8  
Old June 6th, 2005, 03:50 PM
stormcandi stormcandi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 6 stormcandi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 20 m 14 sec
Reputation Power: 0
Question

My reports are linked on the Month Year field. We are running sales goals, totals, and % to goal for employees. The main report query shows the totals for the company broken down into departments.
The subreport needs to show how the company is doing overall. When the report runs, the main is fine. The subreport prints all records in the table regardless of Month Year input into the main report and I can't get the sales totals from the main report into the subreport. The subreport has the company's goals, I just need it to:
a) only print the month indicated by the user when the main report is run.
b) bring the totals for the Month Year requested for the main report & put it into the subreport so I can do the math against the company goals

I am pulling my hair out on this because I have been working this for over a week with very little progress.

I appreciate the help!

Reply With Quote
  #9  
Old June 6th, 2005, 04:08 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Your subreport is linked to the variable in your query, thus when the report formats it needs to run the query twice to display the report and then format the subreport which is causing you to enter the variable more than one time. The easiest work around was suggested by sherrington and that is to make a small form that will hold the variables for your query. Make a small form that will hold the parameter of dates that the user will type in before running your report. Set the query parameters values to this form. A simple form for the dates with a command button to open the report should do the trick. Otherwise you will need to rethink the relationship between the main report and subreport. Without seeing your application, it looks like what information is displayed in the subreport could easily be displayed in the main report without the need of a subreport, that is if you are using the same query for both the main and subreport.

Reply With Quote
  #10  
Old June 7th, 2005, 01:47 PM
stormcandi stormcandi is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 6 stormcandi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 20 m 14 sec
Reputation Power: 0
Question

How would I create a text box that will hold the input from the user? I have tried creating the form as suggested previously but when the form is closed, the information is lost. The user doesn't want to have this form up during their whole session.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Linking subreports and reports


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT