[AccessD] Autonumber when?

Heenan, Lambert Lambert.Heenan at chartisinsurance.com
Wed Apr 6 09:01:47 CDT 2011


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