Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > General

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-01-2003, 07:26 AM
SteveClarkson SteveClarkson is offline
Registered User
 
Join Date: Feb 2003
Location: Kent, SE UK
Posts: 433
SteveClarkson is on a distinguished road
Question Automatically calculated value - how to put in a report?

Hello

My fish database is almost complete now, but this glitch has been bugging me from day 1.

I have a main fish form "frm Fish enter"
That form has 2 subforms, "frm Purchases enter" and "frm Deaths enter"

In the main form, I have a field called "housed", which calculates how many fish the user has of this particular species, by adding taking the total number of deaths from the total number of purchases.

This is done using this formula/expression or whatever you call it:

Code:
=Nz([Purchases].Form!purchasestotal,0)-Nz([frm Deaths].Form!deathstotal,0)
That works great, and I am very happy with it, except one thing...

I have a report which lists all the fish the user has...but I cannot put how many fish there are, as the automatically calculated value I was talking about isn't saved to a table.

Is there are way to make the calculated value save itself to a table (tbl fish) each time the form is closed or something? Or is there a better way round this problem?

Thanks very much for any help you can offer.
__________________
Steve
Reply With Quote
Sponsored Links
  #2  
Old 08-01-2003, 07:31 AM
Waltang Waltang is offline
Member
 
Join Date: May 2003
Location: SE Texas
Posts: 32
Waltang
It sounds like your report just needs a running sum field.
Reply With Quote
  #3  
Old 08-01-2003, 09:13 AM
SteveClarkson SteveClarkson is offline
Registered User
 
Join Date: Feb 2003
Location: Kent, SE UK
Posts: 433
SteveClarkson is on a distinguished road
How might I go about making that work? The fields I think you probably need (the quantities of fish bought and died) are not in the report.
__________________
Steve
Reply With Quote
  #4  
Old 08-04-2003, 07:49 AM
Waltang Waltang is offline
Member
 
Join Date: May 2003
Location: SE Texas
Posts: 32
Waltang
Can you add them to the report and make them not visible?
Reply With Quote
  #5  
Old 08-04-2003, 08:08 AM
neileg's Avatar
neileg neileg is offline
AWF VIP
 
Join Date: Dec 2002
Location: Newcastle, England
Posts: 5,970
neileg has a spectacular aura aboutneileg has a spectacular aura about
...or add them to the query on which your report is based and refernce these in the report.
__________________
You can't always get what you want, but if you try sometimes you may just get what you need - Rolling Stones

Cheers, Neil
Reply With Quote
  #6  
Old 08-04-2003, 08:09 AM
Rich
Guest
 
Posts: n/a
Just add the fields to the reports underlying query, then it's just Sum([Sold]-[Died])
Reply With Quote
  #7  
Old 08-04-2003, 09:29 AM
SteveClarkson SteveClarkson is offline
Registered User
 
Join Date: Feb 2003
Location: Kent, SE UK
Posts: 433
SteveClarkson is on a distinguished road
OK, with a bit of fiddling, I have managed to get it to work to a certain extent!

I now have a field on the report with this control source:

Code:
=Sum(Nz([tbl Purchases.Quantity],0))-Sum(Nz([tbl Deaths.Quantity],0))
That is roughly the same code as is in the form, except with the additions of SUM.

It returns some weird values though, that I cannot figure out for the life of me!


An Example:

4 Purchases & 7 Purchases
2 Deaths

Should return 9 [(4+7)-2]. It returns 9 in the form...that is fine.

In the report...it returns 7??? It all works OK until you add a death, then the numbers go weird?!?

Help!
__________________
Steve
Reply With Quote
Sponsored Links
Reply

Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:46 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World