This is an embarrassing question to which I should know the answer, but
I am not 100% sure of myself. My applications, whether they are Jet or
Oracle usually deal with reporting on existing apps that others have
done and except for the odd single user app, I don't do many transaction
type applications....
Anyways,
I have an unbound form which is a data entry form for new records or in
"add record" mode. Say this form is for creating requisitions. The
user enters all the criteria in numerous unbound controls. User then
clicks a save button or tool bar item and an insert/append statement
takes place and the table in question, now has a new record. A PK is
created for the new record via an autonumber (or trigger/sequence in
Oracle).
Say the new record is a requisition and the form has a subform for line
items which is enabled with the save procedure. To add these records to
the subform, I'm going to need the PK of the record I've just created.
I would appreciate any comment or alternate approach that is better than
the following approach:
1) Create and run the insert/append SQL statement
2) Use a DAO snapshot recordset (this is A97) and use .movelast to go to
last record.
3) Take the new PK and store it in a form variable or control.
My area of worry is the .movelast method on a multi user database.
Probably very remote, but don't I run the risk of moving last to another
user's new record that was inserted at about the same time as my own?
I need some reassurance or pointing in another direction, thanks very
much in advance.
--
Tim - http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Want some?" - Ditto