473,383 Members | 1,958 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,383 software developers and data experts.

Text Box Control unbound doesnt Sum

Hi,

I have form with four text box controls.
3 text box controls are bound to table A, and 4 text box control sums values
in this 3 text boxes with formula in Control source.
txtBox4=[txtBox1]+[txtBox2]+[txtBox3]
If I dont enter number in one of text boxes, txtBox4 doesn't show result. I
guess it considers it is Null value.
I would like that if I dont enter number in text box, txtBox4 considers it
as number 0.
Does anyone know how to fix this?

Thanks for your help, Marco
Nov 12 '05 #1
2 1773
On Tue, 3 Feb 2004 23:27:37 +0100, "Marco Simone" <ma*********@net.hr>
wrote:
Hi,

I have form with four text box controls.
3 text box controls are bound to table A, and 4 text box control sums values
in this 3 text boxes with formula in Control source.
txtBox4=[txtBox1]+[txtBox2]+[txtBox3]
If I dont enter number in one of text boxes, txtBox4 doesn't show result. I
guess it considers it is Null value.
I would like that if I dont enter number in text box, txtBox4 considers it
as number 0.
Does anyone know how to fix this?

Thanks for your help, Marco

Nulls propogate through an expression.

Use the Nz function to convert it to a zero for summing. In the
control source for the textbox use...
= Nz ([txtBox1]) + Nz ([txtBox2]) + Nz ([txtBox3])

- Jim
Nov 12 '05 #2
Marco Simone wrote:
Hi,

I have form with four text box controls.
3 text box controls are bound to table A, and 4 text box control sums values
in this 3 text boxes with formula in Control source.
txtBox4=[txtBox1]+[txtBox2]+[txtBox3]
If I dont enter number in one of text boxes, txtBox4 doesn't show result. I
guess it considers it is Null value.
I would like that if I dont enter number in text box, txtBox4 considers it
as number 0.
Does anyone know how to fix this?


Yes, wrap every reference in the Nz() function. The expression becomes
txtBox4=nz([txtBox1])+nz([txtBox2])+nz([txtBox3])
--
Bas Cost Budde
http://www.heuveltop.nl/BasCB

Nov 12 '05 #3

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

Similar topics

2
by: John Kreps | last post by:
(acc 2002) I've got six unbound text boxes on a subform that has a white background. Each of those six boxes has an expression that when true, will change its background from white to another...
2
by: Zlatko Matić | last post by:
Hello. I have the following problem with MS Access/PostgreSQL combination: There is a form in Access that has an unbound text box, used for entering a commentary of a batch of records. There is a...
2
by: hmiller | last post by:
Hope I make my case clear!!! I have a table with two bound date/time fields. I want to be able to use an IF statement and DateDiff to return a text message in an unbound text box. I want to do...
2
by: john | last post by:
My report is based on a query with user input . In my report I have a text box with the following code: =. This works when the query outcome is 1 or more records. But when the query output is zero...
3
by: scott_baird | last post by:
Probably something simple, but it's driving me up the wall... In a report, I have an unbound control that is the total of 2 other bound controls (currency) as follows: unbound control =cash1 +...
1
gcoaster
by: gcoaster | last post by:
Hello Group, I was wondering if anyone out there can help me I have a form Unbound List Box Control on the form The row source is a built-in query. I was wondering if there is anyway to...
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
1
by: MyWaterloo | last post by:
I have an unbound text box on my main form that is used to show the sum totals in my sub form. I also have a field on my main form that has a control source in a table. This bound field needs to...
29
by: kstevens | last post by:
I have a form with 12 unbound comboboxes whose query is determined from the combobox before it. Example: No2 box rowsource is set to the query and then requeried on the afterupdate of box1. Now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.