[AccessD] Autonumber when?

jwcolby jwcolby at colbyconsulting.com
Wed Apr 6 09:19:34 CDT 2011


If you go all the way back to my original post, I showed where I modified that first method to a 
second method where I do what you are discussing...

I said that the first method did not work, but the second (which should work) also did not work.

Look for:

 >>>I thought something simple like doing an on error and then checking as follows would work:

and read what follows...

John W. Colby
www.ColbyConsulting.com

On 4/6/2011 10:01 AM, Heenan, Lambert wrote:
> As I said, look again John.
>
> You have...
>
>        With rs
>           .AddNew
>           !PLSL_IDPLSUSR = mlngIDUser
>           !PLSL_FE = CurrentProject.Name
>           !PLSL_Login = blnLogIn
>           !PLSL_WorkstationID = CurrentMachineName()
>           mlngLogID = !PLSL_ID
>           .Update
>           .Close
>       End With
>
> But Gustav (and me if I'd been quick enough) suggests...
>
>       With rs
>         .AddNew
>           !PLSL_IDPLSUSR = mlngIDUser
>           !PLSL_FE = CurrentProject.Name
>           !PLSL_Login = blnLogIn
>           !PLSL_WorkstationID = CurrentMachineName()
>         .Update
>          mlngLogID = !PLSL_ID
>         .Close
>       End With
>
> i.e. there is no attempt to read the autonumber value until *after* the record has been created by the call to .Update.
>
> Lambert



More information about the AccessD mailing list