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 November 25th, 2004, 09:20 AM
Papa44 Papa44 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 2 Papa44 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking Yet Another "Running Total" Question!

OK. Access 97.

RE: Running Total on a Form ----

I'm another newbie at this, so don't get frustrated.

Table name: Sales

Among other fields on my form, there are 3 fields that concern this scenario:

1. Profit (Sell minus Cost) That works fine.

2. Shipping_Profit (Shipping charge + Actual Shipping) That works fine.

3. Total_Profit (Profit plus Shipping_Profit) It gets its total from Profit + Shipping_Profit. That works fine.

4. Profit_To_Date (a running total of Total_Profit) It SHOULD update for each record, but I can't get it to do it!

Now....I understand that Total_Profit is a calculated field. My problem is I don't yet understand how to build an expression for Profit_To_Date because it's based on a calculated field.

I've been referred to the Microsoft site via URL's, but I need a simpler explanation. An simple example would be highly appreciated. Remember, I want this for a FORM and not a query or report.

Sample Data:

ID: ID

Record 1:

Cost: $100.00
Sold: $ 50.00
Profit: $ 50.00

Shipping Charged: $15.00
Shipping Actual: 12.00
Shipping Profit: 3.00

Total Profit: $53.00

Profit to Date: $53.00 <-- this amount should increase/decrease with each following record, based on Profit + Shipping Profit. I would like to have this on my form.

I've been trying to figure this out for 4 days!

Any sample expression would be appreciated. And please keep it simple. I'm new at this and already frustrated!

Thanks to all.

Reply With Quote
  #2  
Old November 29th, 2004, 01:04 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
Papa44,

In order to get a running total on your form, you will need to create a query that will sum the total profit to date for all records. Then make a subform from this query and place this subform onto your main form. You can resize this subform as necessary to give the cosmetic appearance that you want. You will need to requery the subform after new records are added, otherwise the subform will not update to your new profit totals until you close and reopen the main form.

lwells

Reply With Quote
  #3  
Old December 7th, 2004, 07:00 PM
bugs007 bugs007 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 5 bugs007 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
A Simpler way

Hi

Try using this code.It will enter a grand total for all records of the selected field into a unbound text box.

dim curX as currency
curX = DSum("[PurchasePrice]", "tblmain")
Text86 = curX


Just replace "PurchasePrice" with the fieldname u want the running total kept on and replace "tblmain"
with the name of the table.

Result will appear in Textbox of your choice. Just replace the Text86 with the name of the unbound text box where u want to display results.

Hope this helps.

Cheers and Merry Christmas.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Yet Another "Running Total" Question!


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 1 hosted by Hostway
Stay green...Green IT