Results 1 to 5 of 5
  1. #1
    DaltonH is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    1

    May be a strange way to do this, but...

    it's been a while since i have done anything with databases, and i am play around with this as a relpacement to a spreadsheet my boss keeps messing up.



    basically i create a daily financial report called a greensheet every day. this report has daily, month to date, and previous year: month to date categories...


    however two very important fields are [Previous Outstanding] and [Total Outstanding To Date], this is the most important field on the report, and is the one that if i have a day off, my boss attempts to do and i have to fix.... pretty much every time.

    here is the logic behind the Previous Outstanding
    If today is the 1st day of the month, this will be the same yesterday's Total Outstanding to Date.
    If today is not the 1st day of the month, this will be the same as yesterdays Previous Outstanding (this number only changes once a month, but it is on every greensheet)
    If Today is the very 1st record, the todays value is 0

    is there any way for me to define the field so that that logic is automatic?

    once i get this figured out, i will probably be bugging you guys again. btw, i am using access 2010 on microsoft xp. thanks folks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,896
    Essentially, No. Calculation that depends on value in another record of same table is not easy. Can require subquery or domain aggregate function. Saving the calc result will require code. However, advise against saving.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I agree with June. I would be very hard to do.
    The problem in Access is that if the calculated value is stored, and someone edits a value from last month, the calculated value is incorrect - it won't be automatically updated - unless you have a ton of VBA code to ensure the calculated field is recalculated.

    You haven't said anything about the data or the table structure.

    How do you calculate "Previous Outstanding"?
    How do you calculate "Total Outstanding to Date"?

    Are the reports once a month and done or do you go back and pull reports for 2 or 3 months (or a year) ago?
    Maybe (again maybe) with an unbound form, unbound controls and a lot of VBA/SQL the report could be created.

  4. #4
    cphelps is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Apr 2013
    Location
    Australia
    Posts
    6
    I understand the statements about calculated fields and agree. However if this was something that I needed I would probably think about trying to have a macro that used a MakeTable query to capture the required data temporarily and then to move that record to the live table.

    I am not sure if this would work but if it did the macro could be assigned a button on a form and run by the boss without giving him the ability to get it wrong.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,896
    Any code that would accomplish a MAKE TABLE action could just as easily be an INSERT or UPDATE action to existing table.
    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. Strange Problem
    By crowegreg in forum Forms
    Replies: 10
    Last Post: 06-17-2011, 10:32 AM
  2. Replies: 17
    Last Post: 05-23-2011, 07:27 AM
  3. Probably a Strange thing to ask
    By everette in forum Access
    Replies: 3
    Last Post: 03-26-2011, 08:33 PM
  4. A Little bit strange...
    By Maverick1501 in forum Access
    Replies: 0
    Last Post: 03-29-2010, 09:59 AM
  5. Replies: 6
    Last Post: 03-17-2010, 10:09 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