Results 1 to 3 of 3
  1. #1
    mike_980 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2012
    Posts
    58

    Using an update query to create a "totals" table

    Hi guys, not logged on in a while!



    I am currently creating a database for my dads farm which will manage the amount of corn we process. The tables at present include one for individual loads of corn we lead in from fields (tbl_crop) and one for storing bulk loads which we buy in from other farms which will be added in bulk, for example 100tons from X supplier (tbl_bulk) along with some other info.

    I have the forms created and working well for adding the info to the tables and all is well, each load has it's own respective weight which is stored separately in the appropriate tables. What I want to, and is the only way I can think of, is to create a separate table, which is updated with an update query and acts as a live view of how much grain we currently have. There will be forms added in the future which will remove corn from the store when we sell it So the database needs to know how much of each type of grain is in the store at anyone time. It obviously isn't just as simple as adding up all the loads as is is getting added and removed from the store all the time so we need a "current" value for the weights.

    If I didn't explain it very well there then this may help,

    The inputs in basic terms are the loads of corn we bring into the sheds, and the loads of corn we remove from the sheds.

    The output will be a value on how many tonnes we have of each grain type we have in stock.


    You may be thinking that excel would have been better but the system I am designing will give reports also on what each field has yielded, how much was sold to each customer etc etc so access was the choice I made.

    Any help would be much appreciated!

    Using access 2013

  2. #2
    mike_980 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2012
    Posts
    58
    Just been looking, could this be done with an SQL Update statement?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Saving cumulative aggregate data is tricky and risky. It is disconnected from the raw data that produced the values so they are difficult to verify, there is little or no accountability for the data.

    Conventional approach would be to have transactions of incoming and outgoing then calculate the net difference to determine balance whenever needed. Don't you have that with "The inputs in basic terms are the loads of corn we bring into the sheds, and the loads of corn we remove from the sheds."?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. "last" function in totals query
    By WimDC in forum Queries
    Replies: 1
    Last Post: 04-26-2013, 10:55 AM
  2. Writing Code for "After Update" Table Events
    By dipique in forum Programming
    Replies: 10
    Last Post: 07-09-2012, 08:11 AM
  3. Replies: 4
    Last Post: 04-26-2012, 08:25 PM
  4. Replies: 1
    Last Post: 05-13-2010, 10:50 AM
  5. Query Results "Count Totals"
    By tipopilotas in forum Queries
    Replies: 1
    Last Post: 03-26-2010, 10:36 PM

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