Results 1 to 5 of 5
  1. #1
    Arwa is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    3

    Unhappy Budget Calculations

    Hello, and thank you in advance for your time.

    I'm using Ms Access 2007 to create a database that contains 5 different training course that we offer, each course receives a certain budget per year, each time the course is given throughout the year we calculate the cost as follows:

    number of trainees * cost per trainee = Amount spent

    then

    Amount spent - main course budget = budget remaining

    I made a table in access called "Course_Budget" that contains Course_type, Main_Assigned_Budget, Assigned_Date

    and another table called "Course" which has all course information such as number_of_trainees, cost_per_trainee,location, partner, duration and such.

    I created a query as follows

    Course_type, Main_Assigned_Budget, Number_of_Trainees, cost_per_Trainee



    with two calculated fields called "Amount_Spent" and "Budget_Remaining"

    My problem is that the outcome is not accurate, because it deducts the Amount_Spent from Main_Assigned_Budget in every row, which gives different Budget_Remaining every time.

    I just want a way to make it consistent in a way that when it deducts the amount for the first time, the database should know to deduct the new Amount_Spent from that last output.

    I could upload my DB if my explanation wasn't enough.
    and thanks again.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    can you post your table structure?

    If I were doing this I would have a table structure something like:

    Courses
    CourseID (autonumber)
    CourseName
    CourseCostPerClient

    Budget
    BudgetID (autonumber)
    CourseID (number from courses table)
    BudgetAmt (though it appears you're using different costs for the same course for different contracts)
    BudgetYear (since I'm assuming you have an annual budget for each)

    CourseHistory
    HistoryID (autonumber)
    CourseID (number from courses)
    TraineeCount (number)
    CourseDate (date/time if they are one day courses)

    It doesn't appear to be important who your trainees are, you are just after a total count in your calculation. Next it appears from your query that you want the deductions to happen by COURSEID not by the client and you want a running sum where the amount remaining on the budget is the sum of all prior classes subtracted from the budget amount and you want that amount displayed on each row.

    You can do this in a query but it's extremely clunk, particularly if you start to get a lot of data in these fields. If I'm right, and please correct me if I'm not you want your first two rows of your query to appear like this:

    Code:
    Cont Course Train CostCoure Budget Spent Remaining
    SB1  Sm Bus 2     100       100000 200   99800
    SB4  Sm Bus 2     200       100000 400   99400
    if this is actually what you want does it have to be in a query or can you show it on a report and it will be acceptable?

  3. #3
    Arwa is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    3
    Hello rpeare!

    Thanks for taking the time to answer my question, everything you have said is 100% correct, that is exactly how I want it to appear!

    It doesn't appear to be important who your trainees are, you are just after a total count in your calculation. Next it appears from your query that you want the deductions to happen by COURSEID not by the client and you want a running sum where the amount remaining on the budget is the sum of all prior classes subtracted from the budget amount and you want that amount displayed on each row.
    Regarding the report, yes its acceptable but I have no idea how to fit in the running sum in the report and that's where I need help, much appreciated!

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Here's an example of a running sum report.

    My table assumes you can get all of your data into a query (I added an artificial date to create some sort of reliable sorting mechanism.

    on the report you'll notice two additional fields

    TOTALUSED
    REMAINING BUDGET

    You'll notice the TOTALUSED column record source is TRAININGCOST but if you go to the RUNNING SUM property you'll see it says OVER GROUP. This means all your trainingcosts will be summed over the group (I've set up sorting and group by contract type first, then by date. I've given this field in the report the name TOTALTRAINING. Then in the last field BUDGET REMAINING it's just the name of the budget field (BUDGET) minus the total training cost field name (TOTALTRAINING)

  5. #5
    Arwa is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    3
    I just applied that to my DB and it worked perfectly!
    You have such a clear way of explaining things, I followed it and it was flawless,
    Thank you so much for your help and time

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Budget and Collections(Actuals)
    By dref in forum Queries
    Replies: 20
    Last Post: 08-23-2012, 06:12 AM
  2. Replies: 2
    Last Post: 05-19-2011, 04:53 PM
  3. Budget vs Actual
    By chaos in forum Access
    Replies: 1
    Last Post: 05-04-2011, 08:25 AM
  4. Budget and Collections(Actuals)
    By dref in forum Forms
    Replies: 0
    Last Post: 08-19-2010, 03:39 AM
  5. Access - Budget database
    By fanzak in forum Database Design
    Replies: 1
    Last Post: 07-22-2010, 02:24 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums