Full Version: Increment Number using code
UtterAccess Discussion Forums > Microsoft® Access > Access Tables + Relationships
rminche
How do you use the index to find code to increment a number??
dannyseager
I assume you want to add on 1 for each record?

try

=Dmax("YourFakeIDfieldInTable","Yourtablename") + 1
rminche
Yes, thank you.

Is there a book that can help a person understand how to create code??
Larry Larsen
Hi
I very often have to refer to a VBA book for both help and often just clarity on a segment of code.
The book I have to hand is:
Beginning Access 97 VBA Programming
By Robert Smith & David Sussman
Wrox
ISBN 1-861000-86-3
Plus
Recommended Reading Access 97
HTH's
thumbup.gif
rminche
thanks, will surely give it a try
rminche
do i put the code in the table??
R. Hicks
What is this incremented number used for ???
How many records do you antisipate this table to contain over the lifetime of the application ???
Is this a multiuser application where the incremental number must be applied as the record is created ???

RDH
rminche
1. log number

2. thousands, but may purge once a year

3. yes
R. Hicks
Here is the basic answer you need that I made at another post that in related to your problem ...

Basic Answer to Question

RDH
rminche
thanks I will give it a try
rminche
can you have two event procedure for ex. "on Current"?

I tried the code but the last number stays as a 1, and the middle number changes but only up to nine. the 00 in front stay the same
do I need to add something??
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.