473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Report Footer skips record

418 256MB
I am trying to generate a report to show remaining balance on a grant. It does not work when there are more than one project in a grant. rptGrantBalance is based on qryExpDetail. Fields include ProjectNo / Budget / Expense / Balance

If there is only one grant I get correct result but if there is more than one project, the budget only pulls budget for the first project although the Expense adds expenes for all projects. GroupHeader includes, GrantNo and ProjectNo.

How can I fix this problem?

Let me know if further information is needed. Thanks.
Jul 24 '09 #1
30 2226
puppydogbuddy
1,923 Expert 1GB
You are probably grouping by project, then grant. You need to group by grant, then by project since there can be more than one project covered by one grant. Place your report in design view, click the sorting/grouping icon on tool bar and fix accordingly.
Jul 25 '09 #2
MNNovice
418 256MB
No, I checked and I have it sorted correctly. When I looked at the query which is the source of this report - everything looks okay. Why it will do this then? This is such a mystery. I have got to fix this problem today and I don't know how. This is also frustrating.

Thanks for your suggestion though.
Jul 27 '09 #3
puppydogbuddy
1,923 Expert 1GB
If you used the sorting and grouping tool on the icon bar in design view, it over-rides any sorting or grouping done in the query, so look and post back what is showing in the sorting/grouping tool.
Jul 27 '09 #4
MNNovice
418 256MB
The sorting/grouping is shown as this:

GrantNo - Ascending (yes/yes for header & footer)
ProjectNo - Ascending (yes/yes for header & footer)

The report is displayed as follows:

Grant No. 90001
ProjectNo. 65601
Budget: 100,000 Total Expense 40,000 Balance 60,000

ProjectNo. 61002
Budget: 250,000 Total Expenses 100,000 Balance 150,000

GrantNo.90001
Budget 250,000 Total Expenses 140,000 Balance 110,000

It's always taking the budget of the last project listed and not sum of the budget which, in this sample, should be 350,000 and the correct balance for the project should be 210,000. Surprisingly it adds the expenses correctly. I am so frustrated.

Thanks.
Jul 27 '09 #5
puppydogbuddy
1,923 Expert 1GB
ok, look at the formula shown in the grouping control for the budget amount. In order for that formula to work, it has to be preceded by an equal sign or it won't work correctly. it should look something like this:
= Sum([BudgetAmount])

Replace BudgetAmount with the actual name of the field as used in your application.
Jul 27 '09 #6
MNNovice
418 256MB
Thanks for your help. It's appreciated.

Let me explain a little.

My query has these fields:

Budget
Change
TotalBudget = Budget + Change

My Report has this for Budget = TotalBudget

If I do Sum([TotalBudget]), I get a figure that's just way too large. Now I get only the TotalBudget for the last project within a grant.

And yes, I have the equal signs in all the correct places.
Jul 27 '09 #7
puppydogbuddy
1,923 Expert 1GB
let's go over a few basics:
1. all fields in your query should appear in your report, unless you unchecked the show box in the query grid, Is that what happened with [change]?
2. any amounts appearing in the detail section of your report are detail amounts and should not be preceded with an equal sign or the word sum
3. any amounts appearing in a group header or footer should be preceded with an equal sign and the word Sum
4. Given the above, if you are presenting budget detail (salaries, office supplies, etc. you should have a detail line as described above. If not, you should not have any amounts in your detail section.
Jul 27 '09 #8
MNNovice
418 256MB
I don't understand #4. Lines 1 -3 agree on what I have. Do you prefer I post my sample DB and may be you can look at this one report I am struggling with. Let me know.

thanks.
Jul 27 '09 #9
puppydogbuddy
1,923 Expert 1GB
if your Access version is not V 2000 or compatible, I won't be able open your file. Otherwise, ok to send.

what happened with the field named "Change"?
if you have no detail section in your report, then in your group header or footer, you should try totalBudget>> = nz(Sum([Budget],0) + nz(Sum([Change],0)
Jul 27 '09 #10
MNNovice
418 256MB
Mine is MSAccess 2003. will this work?
Jul 27 '09 #11
puppydogbuddy
1,923 Expert 1GB
It might if V 2000 format was selected as the database format. If it wasn't, then
try to send a snapshot of your report in design view.
Jul 27 '09 #12
puppydogbuddy
1,923 Expert 1GB
Based on the title of your problem, is it just the report footer section that is missing? If the report footer section is missing and you using a page footer, then all you need to do is go to view on the command menu, and select report header/footer and Access will add a report header/footer section to the report. Then all you have to do is drag the controls from the page footer (not needed), leaving the page footer empty.
Jul 27 '09 #13
MNNovice
418 256MB
Is this what you wanted? Let me know. Many thanks for your time.
Attached Files
File Type: zip Report.zip (126.3 KB, 105 views)
Jul 27 '09 #14
puppydogbuddy
1,923 Expert 1GB
Yes, that is what I wanted. I think I know what the problem is. You are trying to come up with the Budget subtotals w/o any detail amounts in the detail section. Expenses are no problem because you have a detail amount in the detail section, and quite simply, the total is the sum of the details. If that is the case, the fix is this: Put a tiny, hidden (set visible property to no) textbox control for the detail budget amount , and set your subtotal to be the sum of the details just like you did for expenses. The only difference is that the detail amount for the budget is not visible, while expense detail is visible.
Jul 27 '09 #15
MNNovice
418 256MB
Sorry, it still didn't work. Attached is the snapshot for your review. Oh this is so frustrating.
Attached Files
File Type: zip Report.zip (140.0 KB, 100 views)
Jul 27 '09 #16
puppydogbuddy
1,923 Expert 1GB
When you say it is not working, can you tell me what the amount should be, or better yet, make the textbox for the budget detail visible for testing purposes and place the textbox in blank space between the category and expense detail. That way, we can see budget detail making up the subtotal. And remember what we discussed before.
1. The textbox control in the detail section should not have an equal sign or the word "sum" it should just refererence the underlying field from your fieldlist.
2. The subtotal textbox should have an equal sign and the word sum preceding the underlying field name.
Jul 27 '09 #17
MNNovice
418 256MB
The correct total for
Grant No. MN030086 $2,600,000
Grant No. MN030106 $3,000,000 ($500,000 + 2,500,000)

What it's actually doing is showing $2,600,000 for all three transactions and adding them to get $7,800,000 as total budget which is not correct.

1. I don't have any equal sign - just the field names [Budget] & [Change]
2. I do have equal sign - Sum([Budget]) + Sum([Change])

Hope I answered your questions. Thanks.
Jul 27 '09 #18
puppydogbuddy
1,923 Expert 1GB
You did not move the textboxes over and make them visible so you can see the detail making up the total? You don't have separate textboxes for Budget and Change in the detail? you need to. Then the subtotal calc becomes:
= Sum([Budget]+[Change]). hopefully with textboxes visible can identify whch one is the nissng jnm d
Jul 27 '09 #19
MNNovice
418 256MB
Good morning.

As I understand what's it doing is adding the budget amount as many times it's occuring in the detail section. For example, for MN030086, $2,600,000 occurs 3 times. So it's calculating 2,600,000 x 3 = 7,800,000. Same with the next grant MN030106.

What I don't understand is that Grant MN030106 has two projects, Project 62651 the [TotalFTA Amount] = 500,000 and for Project 65651 it is 2,500,000
Now if I have [TotalFTA Amount] in Grant Footer, why don't I get 500,000 + 2,500,000? Why do I get only one project amount?

Thanks.
Attached Files
File Type: zip Report.zip (142.0 KB, 105 views)
Jul 28 '09 #20
puppydogbuddy
1,923 Expert 1GB
You are getting a painfull lesson on what happens when your database design is flawed.

Your business model is such that one grant can be used for many projects and one project can be funded from many grants. Your business model thus contains a many to many relationship between grants and projects for which Access, like other relational databases, can not enforce accurate results, and must rely on the database designer/programmer to find a work-around.

Access is designed to deal with (and can enforce accurate results from) one to many relationships between entities in the business model. You, therefore, need to convert the many to many relationship in your business model into one to many relationships that Access is designed to deal with.

To do this you must place a so called junction table between the entities in the many relationship. This junction table will have its own autonumber primary key field and two foreign key fields.... the prmary key of each of the other two tables (the grant and project tables). In your case the junction table will also contain the budget amount).

Are you with me?
Jul 28 '09 #21
MNNovice
418 256MB
Yes. I have a tblGrant and tblFund and then I have a tblGrantFunds that contain budget data as well.

Anyway I solved the problem in a different way. I created a main report for the budget info and a sub report for the expense part. Then, I added fields at the grant footer to show budget - expense = balance.

Thanks.
Jul 28 '09 #22
puppydogbuddy
1,923 Expert 1GB
I am glad you found a solution that you can live with. I still feel there is a flaw in your DB design that will continue to require you to find a work-around.

Without seeing your relationship window, this is all conjecture. I think you should have had an account code table that had a field for transaction type. That could be use to join revenue and expense transactions that affect the same account code. If you are interested, you should look at the sample Ledger database that comes with Access. To get to the sample,
1.click the Access icon
2. Instead of selecting "open an existing database", select "Access database wizards, pages and projects".
3. Select "Ledger" sample database loaded with data.
4. Review db structure in relationship window, paying particular attention as to how account codes are handled.
Jul 29 '09 #23
MNNovice
418 256MB
I am not an expert in Access by any measure. But I am trying to learn as I go which is not a very good idea. And I do struggle from time to time. What you say here makes sense and I am somewhat nervous about it. But without direct help from an "Expert", I continue to hit the wall in darkness and try to find my way out.

If you are willing, I could place the zipped version of my DB and may be you can help me design it better. Giving me direction to a better relationship (this part is hard for me to fully understand) structure etc.

Let me know if you are willing. Meanwhile I will read up on the material you suggested.

Many thanks.
Jul 29 '09 #24
puppydogbuddy
1,923 Expert 1GB
If you can convert your file to version 2000 compatible format so that I can read it, go ahead and attach the file here. I don't know how soon I can get to it, but I will look at it ASAP.

In the meantime, take a look at these links. the first one has data models from various access applications. Take a look at a couple of them and see how they were done.......for example, look at the one for hotel and room booking. The second link is for a completely free 23 part tutorial on Access 2003. Take a look at the 4 lessons being with the lesson that says "Relationships".

http://www.databasedev.co.uk/data_models.html

http://www.functionx.com/access2003/index.htm
Jul 30 '09 #25
MNNovice
418 256MB
Thank you so much for your offer of help. Attached is a zipped file for my DB. Feel free to tweak it as you wish. The report I am having difficulty with is called rptBalanceDetailUPA.

UPA is project number 63740 which has several classes. The report fails to show the aggreate budget for FTA Budget field. It should be $85,900,000 but it displays $9,506,225. Also, qryExpDetailUPA shows total budget for $351,877 which is allocated to only one class of project. The correct total budget s/b $107,437,319. For whatever reasons, it's pulling the budget for Class PT10 for $351,877 and not the whole project 63740.

If you can help me that will be much appreciated.

I will definitely read up on those links. Thanks for your kind help.
Attached Files
File Type: zip ECHO0713.zip (426.1 KB, 140 views)
Jul 30 '09 #26
puppydogbuddy
1,923 Expert 1GB
It is going to be a few days before I can look at your file (I generally don't work on the weekend).

In the meantime, here is a download link for 28 Access DB Templates that you can download. I suggest you take a look at the Accounting Ledger template and the Expense Reportng template.

http://databases.about.com/od/access..._Templates.htm
Jul 31 '09 #27
puppydogbuddy
1,923 Expert 1GB
OK, I checked out the problem with FTABudget in srptBalanceDetailUPA (the subreport). This amount is in the Project footer section and the expression bound to this control should be: = Sum([FTABudget]), not FTABudget. Remember, any time you have a header or footer, you are dealing with the total of the detail line amount, and therefore, the field name must be preceded by the equal sign and the word "Sum" as shown above. By the way, you did not need to do a subreport,,,your main report would give you the same info. Do no have the time to look at your query today....maybe tomorrow.
Aug 3 '09 #28
MNNovice
418 256MB
I tried the expression: Sum([FTABudget]) it does not work. What I get is $7,800,000 instead of $2,600,000 for the first Grant MN030086.

How could I get the same info without adding a sub report? Can you elaborate on this issue?

Take your time. I appreciate any help I can get. Thanks.
Aug 3 '09 #29
puppydogbuddy
1,923 Expert 1GB
Attached, please find a revised extract of your mdb and a word document with my comments. Hope this helps.
Attached Files
File Type: zip BudgetReportRevised.zip (291.6 KB, 158 views)
Aug 7 '09 #30
puppydogbuddy
1,923 Expert 1GB
PS: Forgot to attach this link to MS Access Demos on various topics, some of which relate to what you are doing.

http://office.microsoft.com/en-gb/ac...739911033.aspx
Aug 7 '09 #31

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Galina | last post by:
Hello I have a report, which lists records. Each record has money paid field. Money paid can be 0 or not 0. I calculate and print summary of money for a group in the group footer, as well as...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
3
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have...
2
by: SJM | last post by:
I have a report that displays records of real estate properties. It is possible for each property to appear a number of times for various reasons. Each record however is unique. What I would like...
4
by: Bruce | last post by:
Surely someone has done this before, and I am guessing there is a simple solution that is eluding me. I have a simple report based on a recordset. For each record there is a field (RecNum) that...
2
by: Simon | last post by:
Dear reader, In case a report is a sub report the Report Header of the sub report is printed in the report but the Page Header of the sub report will not be printed. This is the same for...
12
D Giles
by: D Giles | last post by:
Access 2003: A subreport control (sum total calculated textbox located in the subreport report footer) does not show total of all records when referenced as a total in the main report footer - only...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
7
by: Evanescent | last post by:
Hi guys, as the title suggests, I'm facing some problems with the report. I have a form (createInvoiceForm) whereby the user can enter the invoice's details and then click on the Add New Record...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.