Totaling textboxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good morning all it appears I am having a brain fade today. I have five text
boxes on a form I would like to total four of them with the total ending up
in the last one. Hopefully all done dynamicly. So that as each number is
entered the total is continuesly up dated. The textboxes are:
strTowcharges
strStorage
strLienFees
strLabor
and the last one should recieve the total
strTotal
I have tried several different formulas and functions but just seem to keep
missing it. Help please
Cliff
 
In the strTotal Control Source write
=Nz([strTowcharges],0) + Nz([strStorage],0) + Nz([strLienFees],0) +
Nz([strLabor],0)

The Nz function used to change the Null to 0
 
Well that worked up to the point where I entered 25.00 into the strTowCharges
and then 35.00 into strStorage. the result in the strTotal now looks like
this: 25003500 which is kind of where I have been, perhaps I have something
formated wrong? Thanks for your help

Ofer said:
In the strTotal Control Source write
=Nz([strTowcharges],0) + Nz([strStorage],0) + Nz([strLienFees],0) +
Nz([strLabor],0)

The Nz function used to change the Null to 0

--
\\// Live Long and Prosper \\//
BS"D


LtFass said:
Good morning all it appears I am having a brain fade today. I have five text
boxes on a form I would like to total four of them with the total ending up
in the last one. Hopefully all done dynamicly. So that as each number is
entered the total is continuesly up dated. The textboxes are:
strTowcharges
strStorage
strLienFees
strLabor
and the last one should recieve the total
strTotal
I have tried several different formulas and functions but just seem to keep
missing it. Help please
Cliff
 
It can happen when the fields you are trying to add up are string, try this

=cdbl(Nz([strTowcharges],0)) + cdbl(Nz([strStorage],0)) +
cdbl(Nz([strLienFees],0)) + cdbl(Nz([strLabor],0))

Or, if the fields are string type, consider changing them to number

--
\\// Live Long and Prosper \\//
BS"D


LtFass said:
Well that worked up to the point where I entered 25.00 into the strTowCharges
and then 35.00 into strStorage. the result in the strTotal now looks like
this: 25003500 which is kind of where I have been, perhaps I have something
formated wrong? Thanks for your help

Ofer said:
In the strTotal Control Source write
=Nz([strTowcharges],0) + Nz([strStorage],0) + Nz([strLienFees],0) +
Nz([strLabor],0)

The Nz function used to change the Null to 0

--
\\// Live Long and Prosper \\//
BS"D


LtFass said:
Good morning all it appears I am having a brain fade today. I have five text
boxes on a form I would like to total four of them with the total ending up
in the last one. Hopefully all done dynamicly. So that as each number is
entered the total is continuesly up dated. The textboxes are:
strTowcharges
strStorage
strLienFees
strLabor
and the last one should recieve the total
strTotal
I have tried several different formulas and functions but just seem to keep
missing it. Help please
Cliff
 
Ok that worked great thank you very much if could ask one question could you
explain the "cdbl" the rest i am familer with thanks

Ofer said:
It can happen when the fields you are trying to add up are string, try this

=cdbl(Nz([strTowcharges],0)) + cdbl(Nz([strStorage],0)) +
cdbl(Nz([strLienFees],0)) + cdbl(Nz([strLabor],0))

Or, if the fields are string type, consider changing them to number

--
\\// Live Long and Prosper \\//
BS"D


LtFass said:
Well that worked up to the point where I entered 25.00 into the strTowCharges
and then 35.00 into strStorage. the result in the strTotal now looks like
this: 25003500 which is kind of where I have been, perhaps I have something
formated wrong? Thanks for your help

Ofer said:
In the strTotal Control Source write
=Nz([strTowcharges],0) + Nz([strStorage],0) + Nz([strLienFees],0) +
Nz([strLabor],0)

The Nz function used to change the Null to 0

--
\\// Live Long and Prosper \\//
BS"D


:

Good morning all it appears I am having a brain fade today. I have five text
boxes on a form I would like to total four of them with the total ending up
in the last one. Hopefully all done dynamicly. So that as each number is
entered the total is continuesly up dated. The textboxes are:
strTowcharges
strStorage
strLienFees
strLabor
and the last one should recieve the total
strTotal
I have tried several different formulas and functions but just seem to keep
missing it. Help please
Cliff
 
The Cdbl is Convert to Double, so it takes a string and convert it to a
number, double type.
Check help on
Cdbl = convert to double
CLng = convert to long
CInt = convert to int

etc\

--
\\// Live Long and Prosper \\//
BS"D


LtFass said:
Ok that worked great thank you very much if could ask one question could you
explain the "cdbl" the rest i am familer with thanks

Ofer said:
It can happen when the fields you are trying to add up are string, try this

=cdbl(Nz([strTowcharges],0)) + cdbl(Nz([strStorage],0)) +
cdbl(Nz([strLienFees],0)) + cdbl(Nz([strLabor],0))

Or, if the fields are string type, consider changing them to number

--
\\// Live Long and Prosper \\//
BS"D


LtFass said:
Well that worked up to the point where I entered 25.00 into the strTowCharges
and then 35.00 into strStorage. the result in the strTotal now looks like
this: 25003500 which is kind of where I have been, perhaps I have something
formated wrong? Thanks for your help

:

In the strTotal Control Source write
=Nz([strTowcharges],0) + Nz([strStorage],0) + Nz([strLienFees],0) +
Nz([strLabor],0)

The Nz function used to change the Null to 0

--
\\// Live Long and Prosper \\//
BS"D


:

Good morning all it appears I am having a brain fade today. I have five text
boxes on a form I would like to total four of them with the total ending up
in the last one. Hopefully all done dynamicly. So that as each number is
entered the total is continuesly up dated. The textboxes are:
strTowcharges
strStorage
strLienFees
strLabor
and the last one should recieve the total
strTotal
I have tried several different formulas and functions but just seem to keep
missing it. Help please
CliffTh
 
Back
Top