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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 
Back
Top