Adding an increasing value not using autonumber

J

Jesse Aviles

I have a couple of forms in which there is a line number field. The user
needs to type a number supposedly in in an incremental fashion (1, 2, 3...).
Instead of making the user type it, I inserted an invisible textbox that
will receive the value of the current record. On the form current event I
have the following line of code:
Text15 = me.currentrecord
The line number textbox has the following expression:
=IIf([Text15]=1,1,[Text15]+1)
When I add the first record (Line number =1), the new record will show 1.
When I move into the second record, the user will have to manually change
the 1 to 2 and from then on the expression will work OK, making the new
default value the next line number. I need to fix the logic in the
expression to make the second row get the value of 2. I hope I've make this
clear enough. Thanks for any help.
 

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