Ask Experts Questions for FREE Help !
Ask
    mcleyn's Avatar
    mcleyn Posts: 48, Reputation: 1
    Junior Member
     
    #1

    May 20, 2010, 08:51 AM
    Getting a Total from 4 textboxes.
    Hi there,

    I am trying to produce a total sum text box from four text boxes inside a form.

    I have tried writing the following macro for total sum text box but it does not work:

    =Sum([textboxName1])+([textboxName2])+([textboxName3])+([textboxName4])

    What is an easier way of doing this?
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #2

    May 20, 2010, 09:02 AM

    First that's not a macro but an expression. And its an incorrect expression. You are saying to return a sum of one control and adding the other three.

    You should have a textbox control with a Controlsource of:

    =[textboxName1]+[textboxName2]+[textboxName3]+[textboxName4]

    That should do the job for you.
    mcleyn's Avatar
    mcleyn Posts: 48, Reputation: 1
    Junior Member
     
    #3

    May 20, 2010, 10:48 AM
    Quote Originally Posted by ScottGem View Post
    First that's not a macro but an expression. And its an incorrect expression. You are saying to return a sum of one control and adding the other three.

    You should have a textbox control with a Controlsource of:

    =[textboxName1]+[textboxName2]+[textboxName3]+[textboxName4]

    That should do the job for you.


    Ok wonderful. That works perfectly. Is it possible to have this textbox that holds the answer of the totals to have another control source that puts this answer back into my table?
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #4

    May 20, 2010, 03:25 PM

    This is a common mistake made by people new to database design. As a general rule we do NOT store calculated values. Such values can be displayed using the same expression wherever you need to display it.
    mcleyn's Avatar
    mcleyn Posts: 48, Reputation: 1
    Junior Member
     
    #5

    May 21, 2010, 05:50 AM
    Quote Originally Posted by ScottGem View Post
    This is a common mistake made by people new to database design. As a general rule we do NOT store calculated values. Such values can be displayed using the same expression wherever you need to display it.
    Ok thank you very much for your help!

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Clear Textboxes [ 2 Answers ]

Hi there, I am using the wizard to retrieve data from a database - vb. Basically I have 2 textboxes and a dropdown list. At runtime when I search using the textboxes and dropdown listbox and click on a search button, the data is populated into a datagrid. I need to know how to clear the...

How to find beginning retained earnings with total revenues and total expenses [ 1 Answers ]

The company's total equity increased by $32,000 during 2011. New stockholder investment during the year totaled $65,000. Total revenues during the year were $500,000 and total expenses were $460,000. Cash on decreased by $7,500 during the year. What amount of dividends did the company declare...

Year end total revenue from total expenses [ 2 Answers ]

I have a financial statement for a non-profit for four clinics, where you have to fill in the missing values. If you have a missing value for total revenue and have the value for total expenses and visa versa. How do you calculate the missing value? Do you obtain it from the...

Enabling textboxes [ 2 Answers ]

Hi there, I wonder if anyone can help. I am looking for code to enable textboxes one by one. Basically I have 3 textboxes with the cell, home and work numbers. So when I double click on the cell textbox it should start dialling that number, while the home and work number textboxes are greyed...

How to find Total Liabilties, Total Stockholder's Equity? [ 0 Answers ]

Net Income $765 Net Sales $36,762 Profit Margin 2.1% Net Sales $36,762 Average Total Assets ($15,719 + $16,078) divided by 2 = $15,898.5 Asset Turnover 2.3 times Net Income $765 Average Total Assets (from...


View more questions Search