View Full Version : adding together two field with formatting


geek
10-19-2009, 11:06 PM
hi,

i've having a problem with the addition of two fields in access 2007.

my situation is the same as Tarah in http://www.access-programmers.co.uk/forums/showthread.php?t=71565.

However, i when i key in 160,000.00 in any of the field, the result will be incorrect. it seems that i cannot put any formatting in field1 or field2.

txtResult = Val([Field1]) + Val([Field2)

i would require currency formatting for my form. can anyone help me? thanks.

RainLover
10-19-2009, 11:20 PM
Are your fields Text or Number?

geek
10-20-2009, 12:23 AM
Are your fields Text or Number?

numbers. they are currencies. for example, $160,000.00

RainLover
10-20-2009, 12:26 AM
Then this should work.

txtResult = me.Field1 + me.Field2

geek
10-20-2009, 12:28 AM
Then this should work.

txtResult = me.Field1 + me.Field2

i tried that method.. it gave me something like this

field1 = 160,000.00
field2 = 100,000.00

-
txtResult = 160,000.00100,000.00

got combined together.. :(

RainLover
10-20-2009, 12:47 AM
Try looking at this attachment.

namliam
10-20-2009, 12:56 AM
i tried that method.. it gave me something like this

field1 = 160,000.00
field2 = 100,000.00

-
txtResult = 160,000.00100,000.00

got combined together.. :(


Just to confirm RainLover, if they are currency fields this shouldnt happen
Both fields (or atleast 1) is text, otherwize this would work.

RainLover
10-20-2009, 12:59 AM
namliam

You are correct.

But I did ask the question and was told that they are Numbers.

namliam
10-20-2009, 01:02 AM
namliam

You are correct.

But I did ask the question and was told that they are Numbers.
I noticed that, which is why I added my reply to the thread...

Basicaly the OP is mistaken...

RainLover
10-20-2009, 01:05 AM
namliam

I thought you were replying to me. Sorry about that.