addition!

slyvsspy

Registered User.
Local time
Today, 01:45
Joined
Jun 24, 2002
Messages
51
I have 24 fields on a form that I need added together. I am doing it through visual Basic. However instead of adding the numbers it literally adds them.

Example.

if the fields are, 2, 33, 6, 8, 5

The output is 233685 instead of 54.

Can anyone help me out of this dilemma?
 
You may have the fields set to be text fields as opposed to number fields.

You could either, convert the fields to numbers in the table's design view, or if the fields need to be strings you could calculate this way:

txtTotal = Val([Field1]) + Val([Field2) + etc.

Numbers, when in text fields, are treated as strings so any attempt to add them actually concatenates them.
 
**

txtTotal = Val([Field1]) + Val([Field2) + etc.



You are a genious! Thanks so much this worked!!!
 

Users who are viewing this thread

Back
Top Bottom