Problem Adding Fields in a Form (1 Viewer)

JGravesNBS

Registered User.
Local time
Today, 09:00
Joined
Apr 5, 2014
Messages
58
TC is a unbound Combo Box, when operator enters TC the Description and Amount is pulled from the Combo Box into unbound fields as follows:

TC Description Amount
42 Hats 8
32 Pins 5

Total 85

Total=nz([trans code2 amt])+nz([trans code3 amt])

My Total should be 13

Why is Total concatenating the values 8 and 5?

Amount are Total are unbound Currency 2
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 09:00
Joined
Aug 30, 2003
Messages
36,128
Try

Total=nz([trans code2 amt],0)+nz([trans code3 amt],0)

If that doesn't work wrap each in CInt() or the appropriate type.
 

JGravesNBS

Registered User.
Local time
Today, 09:00
Joined
Apr 5, 2014
Messages
58
This worked

Total=nz([trans code2 amt],0)+nz([trans code3 amt],0)

Thank you
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 09:00
Joined
Aug 30, 2003
Messages
36,128
No problem. I think the default for the Nz() function is a ZLS, which would have led to your problem.
 

Users who are viewing this thread

Top Bottom