how to show results to an expression on a query or table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ashley J

    #1

    how to show results to an expression on a query or table

    I need help!! I'm using Access 2003 and I'm a inexpreienced user. I have the expression (=[amount]-[payment]) set up in a form for balance. When I enter the data into the form the balance box displays the result. However when I open the table the amount is not displayed in the column for balance. This also happens when I run a query. How can I get the information to show up in the balance column in both the table and the query?
  • gnawoncents
    New Member
    • May 2010
    • 214

    #2
    Ashley,

    When you set the control source to an equation, it is no longer linked directly to the table, so it won't update.

    Something you could do is set the field to reflect exactly what is in the table and use a little VB to update.

    For example, assuming the fields are [amount], [payment], and [balance] in both the table and form, you would do the following:

    1. Set the control source of [balance] to "[balance]" (without the quotes)
    2. Add an after update event to the [amount] and [payment] fields on the form that looks like this:
    Code:
    Me.balance = Nz([amount], 0) - Nz([payment], 0)
    Let me know if that works for you.

    Comment

    Working...