How can I apply a "A=A+b" action on a form or table

K

Kia Kahhali

I need to do a mathematical action like "A=A+B" wher A and B are two text
boxes in a form referring to datas in my query.
whould you please let me know how can I do that.
 
D

Douglas J. Steele

To ensure that Access recognizes that you're talking about controls on the
form, you should refer to them as Me!NameOfControl (or Me.NameOfControl). If
the control name has spaces or special characters in it (not recommended, by
the way), you'd use Me![Name Of Control]

To ensure that Access realizes you're dealing with numbers, and that you
don't want text characters concatenated, you should use:

Me.A = CDbl(Me.A) + CDbl(Me.B)

You could use CSng, CDec, CLng or CInt instead, depending on the data types
of the underlying fields.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top