VWD 2008 Express. Visual Basic.
I have embedded a subform within another formview, which means that I am having to handle the insertion of a new record with code, as I am writing first to one table a new record based on the data in the main form, then based on the primary key value assigned to that new record, I am writing records to another table from the data contained in the subform. The problem I am having is getting the primary key value assigned to the main record, so that I can write its value to the table tied to the subform. Thus the main table and the sub table are tied together by the primary key value.
The code below works to write the sata to the primary table. But after that is done, how can I retrieve the value of the primary key of the record just inserted? I have marked in RED the place where I need to get the value. Thanks for the help.
Go to the complete details ...