Results 1 to 5 of 5

Thread: field addition

  1. #1
    Join Date
    Jan 2010
    Posts
    2

    Unanswered: field addition

    Hello all,

    I'm new to access, I'm taking an intro to databases course. I might be getting a head of myself, but I was a little curious:

    How would you add the value of two fields together? Lets say, one field is RentalFee, and the other field is the MembershipFee. A third field would be the TotalFee and would be the sum of the values from the first two fields. I suppose this has something to do with a query or something, but we've only really worked with tables so far.

    Can anyone provide a quick "general idea" sort of thing for how or if this could be done?

    Thanks!
    -Leo

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    There are a number of ways to do this, but the important thing to remember is that most calculated fields such as this one, should never be saved to a table, but simply re-calculated when needed for display or printing.

    To display it in your form without resorting to a Query, simply assign this to the TotalFee field's Control Source Property:

    =[MembershipFee] + [RentalFee]


    If your form is based on a Query, you could create a calculated field like this:

    TotalFee:[MembershipFee] + [RentalFee]

    then use TotalFee field as the Control Source of your TotalFee textbox on the form.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    And if you want the reason why this is a sound relational database concept google transitive dependencies.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Jan 2010
    Posts
    2
    Thanks very much for the info, folks!

    -Leo

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad we could help!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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