B
BruceM
Is it possible to use code to assign an incrementing primary key value (that
is to say, the PK value is one greater than the previous saved record) in a
multi-user environment in such a way that the value will be displayed on a
form when the user begins the record, but will be reassigned if another user
starts a new record at the same time? I am creating a PK along the lines of
RPT 05-01, RPT 05-02, etc. as a text field. No problem there, except that if
I assign the value in the form's Current event (If Me.NewRecord Then ...)
there could be a duplicate PK error (3022) in a multi-user environment. I
suppose I could save the record as soon as it is started, thus locking in the
PK, but I had hoped to use error handling to go back and get a new PK in the
event of duplication. For the (possible) convenience of anyone replying to
this question I will say the number is assigned through a called procedure
named AssignNumber.
is to say, the PK value is one greater than the previous saved record) in a
multi-user environment in such a way that the value will be displayed on a
form when the user begins the record, but will be reassigned if another user
starts a new record at the same time? I am creating a PK along the lines of
RPT 05-01, RPT 05-02, etc. as a text field. No problem there, except that if
I assign the value in the form's Current event (If Me.NewRecord Then ...)
there could be a duplicate PK error (3022) in a multi-user environment. I
suppose I could save the record as soon as it is started, thus locking in the
PK, but I had hoped to use error handling to go back and get a new PK in the
event of duplication. For the (possible) convenience of anyone replying to
this question I will say the number is assigned through a called procedure
named AssignNumber.