Getting the sum of several fields

I created a field called cash in a MS Access form, I want the totals
for these  fields 100 50 20 10 5 to be placed in that cash field. In
the control source for the cash field I am using
=Sum([100]+[50]+[20]+[10]+[5]) and thought that would work but it
does
not. I can do a sum of two fields, but anything larger does not work.
What am I missing

Dave

0
oliver_optic
5/2/2007 10:30:04 PM
access.forms 6864 articles. 2 followers. Follow

2 Replies
620 Views

Similar Articles

[PageSpeed] 48

I'm not entirely clear on the data structure underlying your form.  Are you 
saying you have multiple fields ([100], [50], ...) and want to total across 
them?  If so, you've just described ... a spreadsheet!  Is there a reason 
you aren't doing this in Excel?

Access is a relational database, and you won't get the best use of its 
features and functions if you try to feed it 'sheet data.  If my above 
interpretation is correct, and if you don't want to use Excel, you'll need 
to brush up on "normalization" if you want to get the best out of Access.

In a well-normalized Access table, each of those "fields" you described 
would be a category in a single field, plus one more for whatever you were 
entering in those.  With this design, Access can provide a simple Totals 
query, and if you ever need to add more categories, you WON'T have to modify 
your table structure, your queries, your forms, your reports, your code, ...

Regards

Jeff Boyce
Microsoft Office/Access MVP

"oliver_optic" <funny_funster@yahoo.com> wrote in message 
news:1178145004.648854.321750@l77g2000hsb.googlegroups.com...
>I created a field called cash in a MS Access form, I want the totals
> for these  fields 100 50 20 10 5 to be placed in that cash field. In
> the control source for the cash field I am using
> =Sum([100]+[50]+[20]+[10]+[5]) and thought that would work but it
> does
> not. I can do a sum of two fields, but anything larger does not work.
> What am I missing
>
> Dave
> 


0
Jeff
5/2/2007 11:17:50 PM
Yikes! I really don't like your naming conventions.  Add something to denote 
they represent a control on your form.
In my example, I added ctl to your names:).
Anyway, on the Enter event of your field Cash, put:
Private Sub Cash_Enter()
Me.Cash = ([Ctl100] +[Ctl50] + [Ctl20] + [Ctl10] +[Ctl5])
End Sub
When you tab into the cash field it will be updated with the sum of your 
boxes.
 Make sure your controls are formatted as numbers.

HTH
Damon


"oliver_optic" <funny_funster@yahoo.com> wrote in message 
news:1178145004.648854.321750@l77g2000hsb.googlegroups.com...
>I created a field called cash in a MS Access form, I want the totals
> for these  fields 100 50 20 10 5 to be placed in that cash field. In
> the control source for the cash field I am using
> =Sum([100]+[50]+[20]+[10]+[5]) and thought that would work but it
> does
> not. I can do a sum of two fields, but anything larger does not work.
> What am I missing
>
> Dave
> 


0
Damon
5/2/2007 11:20:00 PM
Reply:

Similar Artilces:

Message From Field in Folder
When viewing the list of my new messages, is there a way to see the email address of the sender instead of the alias before I open it? In the From column I see "John". When I open the email I see "John <john@johnsemail.com>". I want to see the "john@johnsemail.com" before I open it so I can tell the difference between emails from "Microsoft Support <yourfu@edifyouopenedthis.com>" and "Microsoft Support <someguywhosreally@microsoft.com>" I am currently using outlook 2002 and 2003 alternately based on my mood. Mike If you ...

modify fields
Hi - just started using CRM and have several questions. 1. How do I modify the COUNTRY field? I want a user to be able to type in the name of the country and return and display the 2-letter country abbreviation? Do I have to build a new table for that or can I modify the country field as it is now? 2. How do I apply or change field rules such as case- convert, etc. for either existing fields or fields I create? Thanks in advance for any assistance you can give me. Cheers Ruthie I think the existing country field is a simple text field. You cannot out any logic behind these fields. One op...

All Task bars gone How do I get them back?
All of a sudden the other day everything at the top of my screen disappeared. I can load my word documents by searching my files and double clicking on the name but I can not Open a document inside word. I have never seen anything like this where all the buttons for using Word are gone. How do I get them back. http://www.gmayor.com/my_toolbars_are_missing.htm or http://word.mvps.org/FAQs/AppErrors/MissingMenusEtc.htm -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP ...

Getting the longest string
XML <data> <option>this is test 1</option> <option>this is test 11</option> <option>this is test 111</option> <option>this is test 1111</option> <option>this is test 11111</option> </data> The 5 option has the longest content. I need to get that length and place in a variable. The test has to look across all of the option nodes and return the longest one. Any suggestions? Cheers Keith Keith Chadwick wrote: > <data> > <option>this is test 1</option> > <opti...

Re: How to get all mails, even those for unknown recipient
Yes, good idea :) It is all i need (for example http://www.christensen-software.com/cscatchall.htm) But i wish those NDR are generated. To inform user that used address might be misstyped Is it posible to combine catchall mailbox with a ability of standard NDR generating? TIA Martin Blackstone - MVP wrote / napisal(a): > I think you are talking a Catch All mailbox. > Check this out > http://mostlyexchange.blogspot.com/2005/04/creating-catch-all-mailbox-in-exchange.html > > > "guzzi" <guzzi@_DOT_yandex.ru> wrote in message news:OoSFMGZhGHA.12...

enter value based on drop down list of another field?
I have an excel 2003 spreadsheet with 3 worksheets. In sheet 1, I created a drop down list in column A based on values in sheet 3, column A (item number). Thisd data comes from sheet 3, where I have column A (Item #'s), column B (Item desc)an Column C (price) In column B of sheet 1, I have Item Descriptions and in column C I have price. I want this to automatically fill in based on what I enter in the column A sheet 1 and it should get the corresponding values from sheet 3 column B and C. I can make the drop down list in sheet 1 column B and C, but some of the descriptions need ...

Get paid to surf
Surfjunky pays up to .75$ per hour you surf, no limit to how long you surf. I've had an account for 2 days now, and i've let it sit and i've raked in 27$ http://www.surfjunky.com/?r=Etra1n ...

How to get device name?
Hello all: I want to know all the name of devices in my PC, because I want to open them using API CreateFile and test it, how to do?thanks. Hi, what you want do by meanin "test it"? You cant open all devices with the API CreateFile (for several reasons). Regards Kerem -- ----------------------- Beste Gr�sse / Best regards / Votre bien devoue Kerem G�mr�kc� Latest Open-Source Projects: http://entwicklung.junetz.de ----------------------- "Lee Tow" <fbjlt@pub3.fz.fj.cn> schrieb im Newsbeitrag news:#vVH#JkqKHA.4220@TK2MSFTNGP0...

Restrickting from field
Hi, When you create new email, you can click option and tick FROM field. It will be add FROM field and you can use address book to pick up any name. Are their any options or policy to restrict this function? Thanks Using Exchange server? This should not be possible by default - someone has changed the permissions. What version of Exchange? Follow the KB 262054 to see where permissions might be set - and remove groups that shouldn't be there. wschoi wrote: > Hi, > > When you create new email, you can click option and tick > FROM field. > > It will be add FROM f...

I have a problem with getting a total Sum of numbers (URGENT)
I'd really appreciate if someone could help me here. I am using Microsoft Excel 2002 on a Microsoft Office XP system. I a trying to develop a minor league baseball schedule, but am having som problems. I have attached a copy of my spreadsheet to give everyone some idea o what I'm doing here. I have where the fans list the "RUNS, HITS & ERRORS) of both teams an for each game of the series. I then have it set up in the TOTA WON/LOST column where if the T-Bones RUNS are more than the SALTDOG runs, a "1" appears in the WON column. If the SALTDOGS have a highe numbe...

Excel 2007. How do I get un-installed add-ins off the toolbar?
I have 2 Large Icons on the ribbon/toolbar of Excel 2007. These are Omnipage and s-force. Both of these have been uninstalled and I have de-activated both add-ins. How do I get these off the toolbar forever? thanks ...

Getting back a deleted test frame after saving the changes
My son just deleted a text frame with all his work and started a new text frame and then when asked if he wanted to save his work he clicked yes. Is there any way to retrieve that missing text frame when it won't allow you to undo? On Sat, 27 Aug 2005 16:04:01 +0100, Denise wrote (in article <09056FDE-03FC-4988-8AB0-D1EA0896BFC7@microsoft.com>): > My son just deleted a text frame with all his work and started a new text > frame and then when asked if he wanted to save his work he clicked yes. Is > there any way to retrieve that missing text frame when it won't a...

What is the best procedure for Getting a valid COA/License for a XP SP1 system.
I need to find out the best procedure for Getting a valid COA/License for a XP SP1 system. I've checked E-Bay but maybe dealing directly with M/S would be best Bob Robert J. Stevens wrote: > I need to find out the best procedure for Getting a valid > COA/License for a XP SP1 system. > I've checked E-Bay but maybe dealing directly with M/S would be best Not sure you can, anymore - for Windows XP. Assuming you are doing this because it is counterfeit/bad... http://www.microsoft.com/genuine/ -- Shenan Stanley MS-MVP -- How To Ask Questions The Smart ...

Automatic Data Entry Script OnChange Event for Date Field.
Hi, Sub: Automatic Data Entry Script OnChange Event for Date Field. has anyone assigned 'Today date'( new Date()) to a custom date filed on the form - OnChange of a Picklist field, I have the following code. DatefiledName.value = new Date(); This assigns, currect date to the field, but then when I save it does not like it. When I manually assign a date it displays in the format mm/dd/yyyy, and saves correctly, so I changed the script to: d= new Date(); s = d.(getMonth() +1); s += '/' + d.getDate(); s += '/' + d.getFullYear(); DatefiledName.value = s; This also acc...

Data missing from enterprise custom task fields after migrating
We can see the enterprise task fields, but none of the data is displayed in files migrated from Project Server 2003 to 2007. Any ideas? -- michael Michael: What process did you follow for migration? -- Gary L. Chefetz, MVP, MCT, MCTIP Business: http://www.msprojectexperts.com FAQs: http://www.projectserverexperts.com BLOG: http://www.projectserverhelp.com "michaelj" <notreallyme.com> wrote in message news:4BD612D9-D1AD-4FF8-B103-699AB1B54D06@microsoft.com... > We can see the enterprise task fields, but none of the data is displayed > in > fil...

How do I get a copy of Publisher 2002?
I'd like to get a copy of Publisher 2002. I still have Windows 98 on my computer and don't want to upgrade to XP right at this time. Other than ordering off of e-bay or other sites I'm not familiar with, is it possible to get a copy of Publisher 2002 that would be compatible with Windows 98? Amazon.com -- Don Vancouver, USA "Crystal1365" <Crystal1365@discussions.microsoft.com> wrote in message news:33518C70-6D02-4E03-B9C2-2C1FDEEB4A68@microsoft.com... > I'd like to get a copy of Publisher 2002. I still have Windows 98 on my > computer and don...

Can't get at downloaded transactions
While Money was going through it's online update I also was in the process of requesting a download of transactions from a bank which uses web statements rather than direct statements. Somehow things must have gotten out of sync so that now Money is showing I have 19 transactions from this institution to review (which is correct) but it doesn't present me with anything to review when I'm in that account. I've tried re-downloading from the bank but that doesn't help. Any ideas how I can access the downloaded transactions? In microsoft.public.money, Ken wrote: &...

Creating a task with a duration = sum of all tasks durations
Is it possible to have a task that has a duration equal the sum of the duration for a set of tasks and that has work for that task calculated automatically based on a formula of say number of hours per day times the number of days duration? Duration is not additive but work is. Imagine a summary task that has 3 subtasks, each of which lasts one day. If the three are in parallel, starting together, they all finish at the same timne and all work on the summary is complete since all work on its children is complete, The summary task duration is 1 day. But as to work, each subt...

How do i get send/receive back
-- Peter Please reply to Newsgroup for the benefit of others. "Andrea" <Andrea@discussions.microsoft.com> wrote in message news:DA7F81D0-A97A-4265-8676-82A0CDC143FA@microsoft.com... > ...

Customized picklist fields are not showing up in the preview
hi, can you please help me out in the following situation: i have customized my crm 1.2 system in a huge manner. now all customized picklists do not show up in the preview of e.g. opportunity. opening such a related opportunity offers me the possibility to change the picklist field as wanted. note: all built-in picklist fields are showing up in the preview... tia -- Fritz Theiss Did you publish the customizations? And performed an IISReset? After those actions your changes should be visible. Hope this helps, -- Ronald Lemmen Avanade Netherlands "Fritz" wrote: > hi,...

getting consolidate list of "follow up" items
Dear All, I would like to get a consolidated list of items (sent and received mails)that have matured - i.e. whose follow up time is up. I have the habit of tagging a sent mail (after actually sending) for follow up. Similarly, mails received are also tagged for my further action (for follow up). Would appreciate a consolidated follow up report generation way - rather that opening each folder and looking for mature items (i.e. red). Thanks in advance. Sanjay ...

Removing the : in the coment field
When I insert a comment to a field a colon appears. I know this is meant for the user name to appear but I don't want that. In fact, I don't want the colon to appear. Currently I manually delete it from each comment I insert...is there a way to turn that feature off so I merely type in text without having that colon appear?...I am using Excel 2000 Thanks! Kathy You can use programming to insert comments with no user name. There is sample code here: http://www.contextures.com/xlcomments03.html Kathy wrote: > When I insert a comment to a field a colon appears. I know...

How to get Row # in formula?
I have several rows with the same formula but they are seperated, in some cases, by rows with other information to prevent me from just dragging a formula down to other rows. Ex. While in row 13: B13*C13+B13*D13+B13*E13 While in row 20: B20*C20+.... how can I write a formula to populate the "13" or "20" automatically for whatever row I am in? Thanks, Dave You may not be able to drag it, but if you copy row13 formula and go to row 20 it updates does it not? -- HTH Bob "DaveR" <DaveR@discussions.microsoft.com> wrote ...

Sum of values in a form
Folks, I have read numerous threads on this topic, and understand that in order for my Sum() to work I need t ensure all references are made back to the Record Source. I have endeavoured to do this, but am still getting #Error. I am trying to Sum the revenue each tenant provides in a given date range, to give a total revenue figure. If the date range is a whole month, then the expression just takes the value of Rent PCM, and not Rent PCM * No. of Days, which would give some unusual results. My Expression looks like this: =Sum(Nz(IIf([Short Let]=-1,[Rent pcm],IIf(Day([Forms]...

Extracting a word from a long text field
I have a text field (up to 200 characters) and I need to extract a specific word. The text field name is "MEDICATIONS" and the word I need to extract which might appear anywhere in the field is 'VENOFER'. The word need to be entered in a separate field in a query. Could any one help as to how to enter the code in the query? Thanking you Leo In the criteria I entered Like "VENOFER" Or "Venofer" It seems to work. Will it cause any problems down the line? In other wrods is this an acceptable procedure? "Leo" wrote: >...