On Thu, 12 Jul 2007 11:13:30 -0700, 2D Rick wrote:
Quote:
On Jul 12, 11:00 am, fredg <fgutk...@example.invalidwrote: Quote:
>On Thu, 12 Jul 2007 10:29:28 -0700, 2D Rick wrote: Quote:
>>Access2003 on XP2
>>On an un-bound "Single Form" containing 3 un-bound textboxes, I want
>>to add the value in box 1 and box 2 and show the sum in box 3.
| >> Quote: |
>>Mutiply works: Me.Text4 = [Text1].[Value] * [Text2].[Value]
| >> Quote: |
>>Divide works: Me.Text4 = [Text1].[Value] / [Text2].[Value]
| >> Quote: |
>>Add does not work: Me.Text4 = [Text1].[Value] + [Text2].[Value]
| >> Quote: |
>>Sum does not work: Me.Text4 = Sum([Text1].[Value] + [Text2].[Value])
| >> Quote: |
>>Why is something this simple whipping me?
| >>>>
>Word's like "doesn't work" do not tell us much.
>You get nothing shown in the text box?
>You get #Error or #Name in the text box?
>You get an incorrect result?
>You get a concatenated result?
>What?
>--
>Fred
>Please respond only to this newsgroup.
>I do not reply to personal e-mail- Hide quoted text -
>>
>- Show quoted text -
| >
Sorry Fredg, I was getting the #Error in the textbox but after pokin
at it some more I got it to work.
>
I wrapped it with the VAL function.
Me.Text4 = Val([Text1].[Value]) + Val([Text2].[Value])
>
Not sure if this is the right cure but it works.
>
Also, thanks again for all the great solutions you have given me in
the past.
Your always dead on.
>
Rick
|
If you are doing this directly in the control source of an unbound
control, you cannot use the Me keyword. Me is a VBA word and therefore
unrecognized by Access.
Either
=[Text1 + [Text2]
or better ....
=Nz([Text1],0) + Nz([Text2],0)
Look up the Nz function in VBA help.
Note also that since Value is the default property yo do not need to
explicitly write it.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail