jenlion
IS-IT--Management
- Nov 13, 2001
- 215
I have a new "data entry" mode to allow for heavy input in a shorter amount of time than is possible in a bound recordset. Users fill in "client" information, click "save", and the text fields are converted to parameters and a stored procedure is called to quickly add the record.
The record added will have an autonumber key. Problem is that there is a second set of data that will be entered immediately following "client" entry. This second set requires knowledge of the autonumber key that the client received upon entry; each entry here has a foreign key to the client table.
Sure, I can "select top 1 personid from clients where firstname = txtfname.text and lastname = txtlname.text order by personid desc", but it is entirely possible that another data entry person will enter a person with the same name (lots of "Joe Smith"s out there) at the same time, and name is the only data entry requirement, so I can't rely on SSN or something. I need to be sure that I've got the absolute correct person. Is there any way to have my procedure return the autonumber value assigned after the INSERT command?
Thanks...
The record added will have an autonumber key. Problem is that there is a second set of data that will be entered immediately following "client" entry. This second set requires knowledge of the autonumber key that the client received upon entry; each entry here has a foreign key to the client table.
Sure, I can "select top 1 personid from clients where firstname = txtfname.text and lastname = txtlname.text order by personid desc", but it is entirely possible that another data entry person will enter a person with the same name (lots of "Joe Smith"s out there) at the same time, and name is the only data entry requirement, so I can't rely on SSN or something. I need to be sure that I've got the absolute correct person. Is there any way to have my procedure return the autonumber value assigned after the INSERT command?
Thanks...