Results 1 to 3 of 3
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Fields with subroutines affecting others

    How do you add an After Update subroutine without it affecting another?

    I have two fields called "1st's" tied to this


    Code:
    Private Sub PaymentReceived1st_AfterUpdate()
    
    
    PaymentGST1st = IIf(Me!GSTRegistered = True, PaymentReceived1st + (PaymentReceived1st / Me!GSTDivisionNumber), 0)
    PaymentGST1st = PaymentGST1st - PaymentReceived1st
    PaymentGST1st = Round(PaymentGST1st, 2)
    
    
    End Sub
    I have another 2 fields called "2nds" tied to

    Code:
    Private Sub PaymentReceived2nd_AfterUpdate()
    
    PaymentGST2nd = IIf(Me!GSTRegistered = True, PaymentReceived2nd + (PaymentReceived2nd / Me!GSTDivisionNumber), 0)
    PaymentGST2nd = PaymentGST2nd - PaymentReceived2nd
    PaymentGST2nd = Round(PaymentGST2nd, 2)
    
    
    End Sub
    The calculations come out fine (albeit they could be shortened) however putting in new figures affects each other.

    I require them separated...

    I had some numbers mixed.... duh.. (although I would like a shorter formula)

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,825
    Could do:

    PaymentGST1st = Round(IIf(Me!GSTRegistered = True, PaymentReceived1st + (PaymentReceived1st / Me!GSTDivisionNumber), 0) - PaymentReceived1st, 2)

    PaymentGST2nd = Round(IIf(Me!GSTRegistered = True, PaymentReceived2nd + (PaymentReceived2nd / Me!GSTDivisionNumber), 0) - PaymentReceived2nd, 2)
    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
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Thanks!

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

Similar Threads

  1. Replies: 1
    Last Post: 07-24-2013, 11:48 AM
  2. Filters in one form affecting another...
    By Dominaz in forum Access
    Replies: 1
    Last Post: 10-25-2011, 04:55 PM
  3. Form calculations not affecting table
    By jdm0804 in forum Forms
    Replies: 3
    Last Post: 09-20-2011, 11:11 AM
  4. Running subroutines and form commands in another database
    By cinciphantom in forum Programming
    Replies: 1
    Last Post: 03-16-2011, 01:55 PM
  5. Transactions over multiple subroutines
    By jp2access in forum Programming
    Replies: 0
    Last Post: 08-30-2009, 10:34 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