473,406 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Summing two textboxes on a form

I have a form called "subCalendar" with two unbound textboxes I simply
need to Sum. I used this below, but get an error. I have the textboxes
set to general number. Any ideas? Thanks!

=Sum(nz([Forms]![subCalendar]![Text1]))+(nz([Forms]![subCalendar]!
[Text25]))

Jul 17 '07 #1
6 8428
slinky wrote:
I have a form called "subCalendar" with two unbound textboxes I simply
need to Sum. I used this below, but get an error. I have the textboxes
set to general number. Any ideas? Thanks!

=Sum(nz([Forms]![subCalendar]![Text1]))+(nz([Forms]![subCalendar]!
[Text25]))
Won't
=nz([Forms]![subCalendar]![Text1],0)+nz([Forms]![subCalendar]![Text25]),0)
work?

Jul 17 '07 #2
On Jul 17, 11:15 am, slinky <campbellbrian2...@yahoo.comwrote:
I have a form called "subCalendar" with two unbound textboxes I simply
need to Sum. I used this below, but get an error. I have the textboxes
set to general number. Any ideas? Thanks!

=Sum(nz([Forms]![subCalendar]![Text1]))+(nz([Forms]![subCalendar]!
[Text25]))
I use the VAL function to get mine to work.

=Sum(nz(VAL([Forms]![subCalendar]![Text1])))+(nz(VAL([Forms]!
[subCalendar]![Text25])))

Rick

Jul 18 '07 #3
I used your format and Rick's =Sum(nz(VAL([Forms]![subCalendar]!
[Text1])))+(nz(VAL([Forms]!
[subCalendar]![Text25]))) , but I still keep getting #Name? in my
textbox. I set in the table itself the fields as being 'double' and
the textboxes all are set to general number for the format.
On Jul 17, 3:25 pm, salad <o...@vinegar.comwrote:
slinky wrote:
I have a form called "subCalendar" with two unbound textboxes I simply
need to Sum. I used this below, but get an error. I have the textboxes
set to general number. Any ideas? Thanks!
=Sum(nz([Forms]![subCalendar]![Text1]))+(nz([Forms]![subCalendar]!
[Text25]))

Won't
=nz([Forms]![subCalendar]![Text1],0)+nz([Forms]![subCalendar]![Text25]),0)
work?

Jul 20 '07 #4
Where are you executing this code?? on what event of what control? on
what form(mian/sub)?
Generally speaking if your using the ' + ' you do not need the ' sum '
bobh.

On Jul 20, 9:20 am, slinky <campbellbrian2...@yahoo.comwrote:
I used your format and Rick's =Sum(nz(VAL([Forms]![subCalendar]!
[Text1])))+(nz(VAL([Forms]!
[subCalendar]![Text25]))) , but I still keep getting #Name? in my
textbox. I set in the table itself the fields as being 'double' and
the textboxes all are set to general number for the format.

On Jul 17, 3:25 pm, salad <o...@vinegar.comwrote:
slinky wrote:
I have a form called "subCalendar" with two unbound textboxes I simply
need to Sum. I used this below, but get an error. I have the textboxes
set to general number. Any ideas? Thanks!
=Sum(nz([Forms]![subCalendar]![Text1]))+(nz([Forms]![subCalendar]!
[Text25]))
Won't
=nz([Forms]![subCalendar]![Text1],0)+nz([Forms]![subCalendar]![Text25]),0)
work?- Hide quoted text -

- Show quoted text -

Jul 20 '07 #5
Thanks.. it works now, I got rid of SUM and just used:

=([Forms]![subCalendar]![Text1])+([Forms]![subCalendar]![Text25])

I have this line typed on the line under properties of the textbox for
'control source'. My form is a subform, a bound form, bound to my
table. So I'm not running this code from an event. The main form which
hold the subform has no relevant functionality.

On Jul 20, 10:09 am, bobh <b5o4b...@isp.comwrote:
Where are you executing this code?? on what event of what control? on
what form(mian/sub)?
Generally speaking if your using the ' + ' you do not need the ' sum '
bobh.

On Jul 20, 9:20 am, slinky <campbellbrian2...@yahoo.comwrote:
I used your format and Rick's =Sum(nz(VAL([Forms]![subCalendar]!
[Text1])))+(nz(VAL([Forms]!
[subCalendar]![Text25]))) , but I still keep getting #Name? in my
textbox. I set in the table itself the fields as being 'double' and
the textboxes all are set to general number for the format.
On Jul 17, 3:25 pm, salad <o...@vinegar.comwrote:
slinky wrote:
I have a form called "subCalendar" with two unbound textboxes I simply
need to Sum. I used this below, but get an error. I have the textboxes
set to general number. Any ideas? Thanks!
=Sum(nz([Forms]![subCalendar]![Text1]))+(nz([Forms]![subCalendar]!
[Text25]))
Won't
=nz([Forms]![subCalendar]![Text1],0)+nz([Forms]![subCalendar]![Text25]),0)
work?- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -

Jul 20 '07 #6
Sorry ... spoke too soon. If I view the subform alone it works OK, but
when I view it from my main form that holds the subform it doesn't
work (???)

On Jul 20, 2:01 pm, slinky <campbellbrian2...@yahoo.comwrote:
Thanks.. it works now, I got rid of SUM and just used:

=([Forms]![subCalendar]![Text1])+([Forms]![subCalendar]![Text25])

I have this line typed on the line under properties of the textbox for
'control source'. My form is a subform, a bound form, bound to my
table. So I'm not running this code from an event. The main form which
hold the subform has no relevant functionality.

On Jul 20, 10:09 am, bobh <b5o4b...@isp.comwrote:
Where are you executing this code?? on what event of what control? on
what form(mian/sub)?
Generally speaking if your using the ' + ' you do not need the ' sum '
bobh.
On Jul 20, 9:20 am, slinky <campbellbrian2...@yahoo.comwrote:
I used your format and Rick's =Sum(nz(VAL([Forms]![subCalendar]!
[Text1])))+(nz(VAL([Forms]!
[subCalendar]![Text25]))) , but I still keep getting #Name? in my
textbox. I set in the table itself the fields as being 'double' and
the textboxes all are set to general number for the format.
On Jul 17, 3:25 pm, salad <o...@vinegar.comwrote:
slinky wrote:
I have a form called "subCalendar" with two unbound textboxes I simply
need to Sum. I used this below, but get an error. I have the textboxes
set to general number. Any ideas? Thanks!
=Sum(nz([Forms]![subCalendar]![Text1]))+(nz([Forms]![subCalendar]!
[Text25]))
Won't
=nz([Forms]![subCalendar]![Text1],0)+nz([Forms]![subCalendar]![Text25]),0)
work?- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -

Jul 20 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Yaroslav Bulatov | last post by:
I made an array of 10 million floats timed how long it takes to sum the elements, here's what I got (millis): gcc -O2: 21 Python with numarray: 104 Python with Numeric: 302...
7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
2
by: Targa | last post by:
<input NAME="TAXRATE" onBlur="this.form.TAX.value = (this.form.TAXRATE.value - 0) * (this.form.ITEM1TOTAL.value - 0) + (this.form.ITEM2TOTAL.value - 0) " Size="4"> In my TAX field I get...
4
by: Andy Weinmann | last post by:
I need to make a form through which I can edit the information for companies. I used a form in which the textboxes read from different columns from a listbox to display the information for a...
11
by: ian.davies52 | last post by:
Is there anything I can do about the apparent limit on the number of textboxes that have calculations as their control source on a form or report in ms-access? I have a query that pulls together...
5
by: BLACKDOG157 | last post by:
I've made a form with a variable number of textboxes. The user fills them out, and then I need to pick up the values he has filled in. The number of textboxes vary depending on a value that the...
7
by: lethek39 | last post by:
Hey I have been trying to figure out how to sum rows and columns in a matrix square. I also have been trying to get the program to list the numbers of the diagonal in the matrix. So far this is the...
3
by: OllyJ | last post by:
Hi guys hope you can help I have a text box for each day of the week in a form and numbers are entered into them (but sometimes they need to be left blank i.e. not 0). I am summing these values...
2
by: zufie | last post by:
I must combine the information from two forms/tabs on a main form. The idea is to insert two checkboxes on the main form. Then based on the checkbox checked would then automatically highlight...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.