If it is a multi user (Lan application) system, it is pretty tricky to use
the Max+1 trick as I found out. Due to the some delay in the network or
whatever, it is easy to get duplicate value. I suppose you have to lock the
table somehow when you do this kind of stuff.
"Gerald Stanley" <(E-Mail Removed)> wrote in message
news:1be4b01c4216a$ad56bf90$(E-Mail Removed)...
> If it is important to your application to have a column in
> strict sequence then I would advise that you do not use the
> autonumber facility but instead have a query that
> determines the max value of the column and adds 1 to it.
>
> Hope This Helps
> Gerald Stanley MCSD
> >-----Original Message-----
> >Hi,
> >
> >I have a table that has an ID field as an autonumber.
> >
> >People create new records through a form, but very
> frequently they end up cancelling the record (deleting it).
> The problem is that if they go and make a new record again
> it will be a number higher - with the amount of deletions
> etc, this has meant eg the IDs go as follows
> 1,2,3,4,6,7,11,28,33,34,35,55,70 etc
> >
> >Is there a way that when they do delete a record I can
> include with the code a preocedure to change the field data
> type from autonumber to number and then back to autonumber
> - I have noticed that if I do this manually it seems to
> reset the autonumber in effect. Will this work?
> >
> >I have thought about having a temporary form which is then
> submitted to the main table... but the idea seems a bit
> overwhelming to me.
> >
> >What do you think? Any examples on code if changing the
> data type will work?
> >
> >Mikey
> >.
> >
|