Hi all,
I have a VBA module that runs on the 'click' event for a button on a form that's opened in 'Add' mode (a typical 'Add' button). In the module I use the command:
DoCmd.RunCommand acCmdSaveRecord
to save the record, and that's working just fine. However, in that same VBA module, I then want to add a record to another table for audit purposes, including the primary key of the record I just added with DoCmd. How can I get the primary key (it's an auto-generated number) from (or after) the DoCmd?
Thanx.
John
I have a VBA module that runs on the 'click' event for a button on a form that's opened in 'Add' mode (a typical 'Add' button). In the module I use the command:
DoCmd.RunCommand acCmdSaveRecord
to save the record, and that's working just fine. However, in that same VBA module, I then want to add a record to another table for audit purposes, including the primary key of the record I just added with DoCmd. How can I get the primary key (it's an auto-generated number) from (or after) the DoCmd?
Thanx.
John