Calculate the Value of a Control on a Form.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Macros
    New Member
    • Mar 2007
    • 4

    Calculate the Value of a Control on a Form.

    Okay, you guys have been a great help in the past so here goes a fairly noob question.

    I've got a value (Balance) that needs to put into a subform (Finances) after it calculates (Payment-Fee), both of which reside in the subform. If I want it to update for that record immediately, where should I put the expression and could you include an example please. Thanks!!
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Originally posted by Macros
    Okay, you guys have been a great help in the past so here goes a fairly noob question.

    I've got a value (Balance) that needs to put into a subform (Finances) after it calculates (Payment-Fee), both of which reside in the subform. If I want it to update for that record immediately, where should I put the expression and could you include an example please. Thanks!!
    Update the value in the After Update event of Balance.
    Code:
    Private Sub Balance_AfterUpdate()
       Me.[Payment-Fee] = 2 * Me.Balance
    End Sub

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32633

      #3
      Originally posted by Macros
      Okay, you guys have been a great help in the past so here goes a fairly noob question.

      I've got a value (Balance) that needs to put into a subform (Finances) after it calculates (Payment-Fee), both of which reside in the subform. If I want it to update for that record immediately, where should I put the expression and could you include an example please. Thanks!!
      You could just set the Control Source of your control (TextBox) to :
      Code:
      =[Payment]-[Fee]
      Without more info in the question there's not much more can be said :/

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        Please remember to provide a meaningful Title for any threads started (Please Use Appropriate Titles for New Threads!). This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.

        MODERATOR.

        PS I've changed this one for you.

        Comment

        Working...