473,379 Members | 1,386 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,379 software developers and data experts.

Missing calculated field in report

418 256MB
I am trying to create a report that will keep remaining balance on each grant. But I am struggling with one little problem (for you gurus out there) all morning. Can someone please help?
Here is the issue at hand:

rptRunningBalance is based on qryExpDetail.
qryExpDetail is based on tblExpDetail
tblExpDetail has these fields (in addition to other): 1)ApAmount and 2)Amount
qryExpDetail has NetAmount which is calculated as:
[ApAmount]*qryGrantFunds.FedRatio

rptRunningBalance has a ProjectNo Footer which keeps this info
Budget
TotalExp = Sum([NetAmount]) + Sum([Amount])
Balance = Budget - TotalExp

Well, if a project does not have an ApAmount I get blank data for Balance. For example, if Project A has a budget of $100 and an expense in ApAmount for $10 but no amount for "Amount" I get a blank balance instead of $90.

I found out that when entering data I have disabled expense column based on category selected. For example if one selects AP then Amount column is no longer enabled. So if there is no data in Amount - my report just ignores the whole thing. When I manually entered a zero the report comes out fine. Here is the code I am referring:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CategoryID_AfterUpdate()
  2.     If Me.CategoryID.Value = 1 Then
  3.         Me.ApAmount.Enabled = True
  4.         Me.Type.Enabled = True
  5.         Me.RefNo.Enabled = True
  6.         Me.cboVendor.Enabled = True
  7.         Me.txtEchoAmount.Enabled = True
  8.         Me.Amount.Enabled = False
  9.         Me.Type.SetFocus
  10.  
  11.  
  12.     ElseIf Me.CategoryID.Value = 2 Then
  13.         Me.ApAmount.Enabled = False
  14.         Me.Type.Enabled = False
  15.         Me.RefNo.Enabled = True
  16.         Me.cboVendor.Enabled = False
  17.         Me.txtEchoAmount.Enabled = False
  18.         Me.Amount.Enabled = True
  19.         Me.Date.SetFocus
  20.  
  21.     ElseIf Me.CategoryID.Value = 3 Then
  22.         Me.ApAmount.Enabled = False
  23.         Me.Type.Enabled = False
  24.         Me.RefNo.Enabled = False
  25.         Me.cboVendor.Enabled = False
  26.         Me.txtEchoAmount.Enabled = False
  27.         Me.Amount.Enabled = True
  28.         Me.Date.SetFocus
  29.     End If
  30. End Sub
How can I fix this problem?


Thanks.
Jul 24 '09 #1
1 1975
ChipR
1,287 Expert 1GB
For starters, add a field to your query defined as
Nz([Amount], 0)
and use that field for calculations instead of Amount.
Jul 24 '09 #2

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

Similar topics

3
by: jdph40 | last post by:
I've been given a database and asked to figure out how to sort a report. The report needs to be sorted on a field that is the sum of a field that is calculated in the underlying query. NetSales...
2
by: Norma | last post by:
I have a table with a UPC#, CasesCompleted, TotalHours, standardGoal (pieces per hour) I am generating a report that groups by UPC and figures out production goals. In the Detail section of each...
2
by: hhathome | last post by:
In my report I have a calculated DateDiff Field, I also have a calculated count field. I'm trying to get a total of the DateDiff field and dividing it by the count field and I'm having problems --...
1
by: shobhit_shanker | last post by:
Here are the relevant "givens" to my problem... Form: frmLaunchRpt - Text Box: txtAsOfDate - Check Box: chkLogEval - Command Button: cmdLaunchRpt Report: rptEvaluation - Text Box:...
4
by: Apple | last post by:
Can I edit an calculated field in my form if needed. Thank you in advance for your help. Sincerely Apple
3
by: Mr. California | last post by:
I'm still a little new to Access, and I'm sure I'm missing some key piece of information, but I can boil it all down to this: I have an Employee table. Two of the fields are Empl_First...
2
by: John | last post by:
I am using Access 2000. One table in my database has a field called RankName. Values inlcude: Officer, Sergeant, Lieutenant. I need create a report that groups these three RankNames into two...
2
by: Olveres | last post by:
Hi, I have managed to work out how to add new lines into a calculated text box. However in this text box some of the outcome fields are empty however when previewing the report it includes the...
3
by: kelley.l.turner | last post by:
Hi all, I am very new to MS Access so please bear with me! I have created a simple calculated field in my data entry form, yet when I view my data table or try to generate a report based on...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.