Hey, I've got a form that a user can "Create New" item effectively adding it to a table, however, lots of supporting data needs to be filled out in the form, and some supporting forms as well (not subforms) before the user can ultimately "Save" or "Cancel" the Add-item form. In the CreateNew_Click event I want to create the new record in the table, which has an auto-numbering ID field which is the key. Anyhow, in the Click event I'm running the SQL code
INSERT INTO tbl_Initiative (InitiativeName)
VALUES ('*******NEWINITIATIVE*******');
Do I have to now run a separate SELECT statement to find the the InitiativeID for the record with InitiativeName='*******NEWINITIATIVE*******' ? Or is there a way for me to return the autonumbered InitiativeID field from the newly created record?
Thanks in advance,
Sam.
INSERT INTO tbl_Initiative (InitiativeName)
VALUES ('*******NEWINITIATIVE*******');
Do I have to now run a separate SELECT statement to find the the InitiativeID for the record with InitiativeName='*******NEWINITIATIVE*******' ? Or is there a way for me to return the autonumbered InitiativeID field from the newly created record?
Thanks in advance,
Sam.