Results 1 to 3 of 3

Thread: Access 2007: Simple math with fields

  1. #1

    Thread Starter
    Hyperactive Member Art W.'s Avatar
    Join Date
    Apr 2002
    Location
    In My Own Little World, But that’s OK because they know me there!
    Posts
    271

    Access 2007: Simple math with fields

    Hello Everyone:

    I am trying to add and subtract fields from one another. I have fields called Balance, Debit and Credit. How do I get the balance to equal balance minus debit plus credit as a running total in my table? Just think of it as a check book. Please be specific on how to do this?

    If this can’t be done what can I do?

    Thanks

    Art W.
    SLEEP: A Totally Inadequate Substation For Caffeine!

  2. #2
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    Re: Access 2007: Simple math with fields

    colum a credit
    colimn b debit

    totalcredit cell = sum(column a)
    totaldebit cell = sum(column b)

    balance = totalcredit cell - totaldebit cell

    you should be able to workout what to do from that

    if you can't you will need to create a small example excell and post it so that we can put the absolute code in for you!

    here to talk

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Access 2007: Simple math with fields

    balance is normally opening balance - sum all debits + sum all credits, not per transaction
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width