i need to add number in existing field when a form open

  • Thread starter Thread starter Spier2vb
  • Start date Start date
S

Spier2vb

i need to add number in existing field when a form open

for example

when i open the form automatically add No. 1 and sum numbers in existing field

thanks
 
On Wed, 7 Apr 2010 06:14:01 -0700, Spier2vb

I am not sure exactly what you mean, but perhaps the DSum function
would work for you? Look it up in the Help file. You can use it as the
ControlSource for a textbox:
=DSum(...)

-Tom.
Microsoft Access MVP
 
Spier2vb said:
i need to add number in existing field when a form open

for example

when i open the form automatically add No. 1 and sum numbers in existing
field

thanks

I agree with Tom that it's not "patently obvious to the casual observer"
what you want to do. I can see a couple of possible additional
interpretations:

(1) you are keeping track of the number of times the record has been
displayed, so whenever you open the form, you want to increment the value of
a field in the record. If this is the case, in the Form Load event, you can
include code to increment the control in which the field is displayed.

(2) you are keeping some kind of total, and want to enter a number, but add
it to an existing field in the record that is displayed. If this is the
case, add an unbound control to the form, enter the value you wish to add
and in the AfterUpdate or LostFocus event of the unbound control, add the
value of the unbound control to the control displaying the field, then clear
the unbound control.

If neither of those, if you'd clarify what it is you want, I'd wager someone
here could make a useful suggestion.

Larry Linson
Microsoft Office Access MVP
 
Back
Top