Results 1 to 14 of 14
  1. #1
    ErnieS is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    15

    Calculation Help

    I have a subform with 5 text boxes that will contain values. I need to add up those values and place in another text box.
    Under the control source for that total box I have the following:

    =[Main]![V1 Potential Loss]+[Main]![V2 Potential Loss]+[Main]![V3 Potential Loss]+[Main]![V4 Potential Loss]+[Main]![V5 Potential Loss]

    "Main" is the table name and Potential Loss is each of the 5 text boxes that I need to add up.

    I get this error: #Name?
    What am I doing wrong?

  2. #2
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    You shouldn't have to reference Tables like that. Try this:

    Code:
    =[V1 Potential Loss]+[V2 Potential Loss]+[V3 Potential Loss]+[V4 Potential Loss]+[V5 Potential Loss]
    If the above Formula doesn't work, then most likely the Form isn't properly linked to the Table/Query. At that point I would check the Record Source in the Form's Properties as well as Link Child Fields and Link Master Fields in the Subform's Object.

  3. #3
    ErnieS is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    15
    The Record Source is listed as the right table that has all of the fields that I want to add up.

    Where do I find Link Child Fields and Link Master Fields

    I can't find them. How should they be set up?

  4. #4
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    They would be in the Properties of your Subform (as selected in your main Form). However, if all of the fields you're working with are in the same Subform, then you actually shouldn't have to worry about this.

  5. #5
    ErnieS is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    15
    Yes. All of the fields that I am working on are in the same subform.

    My control source is the Field in the Table.
    The default value has the formula that you provided in it.

    I enter a value in one of the fields and nothing appears in the Total field.

  6. #6
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Since you have a newer version of Access than me, there's no way for me to take a look at your database to see exactly what's going on. . .

    Is there any way I could see a screenshot of your Form? It might help me get a better grasp of what you're trying to do and where the problem is coming from.

  7. #7
    ErnieS is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    15
    Here is a screen shot of my DB. The columns that I want to add up are the Potential down, Actual down, Atty Fees down and place the totals in the box at the bottom of each column.

    All fields are on the same table.

    I've saved a screen shot in a word doc.

  8. #8
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Quote Originally Posted by ErnieS View Post
    . . . and place the totals in the box at the bottom of each column. . . .
    If you're summing Columns, just use =SUM([FieldName]). If you put that total line in the Form Footer (of the Subform, obviously) it should do what you want. Also be sure to use the Table's Field names and not the Form's Field names.

    I'm assuming each row in the Subform is it's own Record. Additionally, is the information at the top of the Form stored in the same Table or is it a different one?

  9. #9
    ErnieS is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    15
    So a couple of things.

    Yes the info at the top is in the same table.

    Each row is not it's own record. All rows are attached to the top information under the loan number.

    I don't have the total line in the footer. Does it need to be?

    I'm also going to need to be able to calculate across which would be Potential - Actual - Atty Fees = Savings.
    Last edited by ErnieS; 07-07-2010 at 12:43 PM. Reason: Added info

  10. #10
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    OK, apparently it's possible to save an Access 2003 database in 2000 format. Would it be possible for you to post a copy of your database (as an Access 2000 DB) for me to look at? Obviously, if there's any proprietary or private data in the database, delete that from the copy you post here.

    If I can take a look at the database itself, I might get a better look at what's going on. I have a sneaky suspicion I already know what's going on, but I'd like to be sure before I say anything.

  11. #11
    ErnieS is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    15
    I really appreciate you taking the time to work with me on this.
    Unfortunately it is not possible to post a copy of the data base because the tables are loaded with confidential information including email addresses and phone numbers.

    Can you provide any other ideas for me to try?

  12. #12
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    OK, I just made a silly little database with 1 Table and 2 Forms.

    The Table had 5 Fields in it:
    V1 Potential Loss (Double)
    V2 Potential Loss (Double)
    V3 Potential Loss (Double)
    V4 Potential Loss (Double), and
    V5 Potential Loss (Double)

    The Forms were an empty main Form with a Subform that has 6 Fields in it.
    The first 5 Fields were linked to the Fields in my Table and the 6th was an Unbound Field.

    I put the following Formula in my Unbound Field:
    Code:
    =[V1 Potential Loss]+[V2 Potential Loss]+[V3 Potential Loss]+[V4 Potential Loss]+[V5 Potential Loss]
    Everything worked perfectly. It even updated as I changed the numbers in my Subform.

    In short, I got no clue

    Sorry I couldn't be of more help.

  13. #13
    ErnieS is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    15
    Quick question.......Where did you place the code?

    I did find one difference in that I had the table fields set as currency.

  14. #14
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    I just typed the Formula into the text box that was supposed to show the total. Here's the database so you can look at exactly what I did.

    I went ahead and added an ID field to the Table and then changed the Form fields to Currency.

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

Similar Threads

  1. Calculation Help
    By edge5511 in forum Programming
    Replies: 4
    Last Post: 12-18-2015, 11:11 AM
  2. Ratio calculation - Need help
    By Kai in forum Queries
    Replies: 5
    Last Post: 06-14-2010, 08:25 PM
  3. Inventory Calculation
    By ser01 in forum Queries
    Replies: 1
    Last Post: 04-24-2010, 12:24 PM
  4. calculation in a query
    By elmartinez in forum Queries
    Replies: 3
    Last Post: 02-12-2010, 03:23 PM
  5. Calculation
    By thestclair in forum Reports
    Replies: 1
    Last Post: 04-29-2006, 11:03 AM

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