Incrementing data and storing in field

P

paduanow

I have a field call control_source that is a numeric field. I want to
increment the field by one for every saved record. I could use an Auto
number type but I must have 20 digits stored and the auto number type does
not allow for lead Zeros. Lead 0s are a requirement. I have an auto number
field called ID.

So I tried to add 1 to the control_source field On Click Save button by
control_source = ID + 1 (my C program habit)

I know this does not work. Is there a simply syntax I am missing. I want
to put this into a procedure if possible. Do I need to write a function?
 
K

KARL DEWEY

I have a field call control_source that is a numeric field. ... Lead 0s are
a requirement.
A number field does not have leading zeros. You must have a text field or
you are formating the number field into a string with leading zeros.

You can use BeforeUpdate event to pull maximum control_source + 1 for the
text box.
 
P

paduanow

I understand that I must have a text field. But it still did not work.

It stays a 1 all the time.
 
P

paduanow

I got it, but I did use the auto number type and put the 20 lead zeros in the
format
location.

thanks Karl.
 

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