DatabaseDude
Programmer
Here's a routine I'm inheriting, and I'm getting unexpected values after adding a trigger to a table.
tblProposal has an insert trigger, that adds a record to another table upon a record being added. (stating the obvious there, aren't I? sorry)
A record is added to tblProposal in VBA. The ID of that record is then captured to use in following steps.
However, v_nIDProposal is assigned the ID of the other table -- the scope identity if you will. This causes the rest of the code to fail, as no such record with ID value of v_nIDProposal is located.
Is there a more reliable way of capturing the proper IDProposal, thru VBA, after the record is updated? I'm urging the client to make this a stored procedure ultimately, but I'm not sure they want to take time for that immediately.
Thanks in advance!
tblProposal has an insert trigger, that adds a record to another table upon a record being added. (stating the obvious there, aren't I? sorry)
A record is added to tblProposal in VBA. The ID of that record is then captured to use in following steps.
Code:
rsDest.Update
v_nIDProposal = rsDest!IDProposal
However, v_nIDProposal is assigned the ID of the other table -- the scope identity if you will. This causes the rest of the code to fail, as no such record with ID value of v_nIDProposal is located.
Is there a more reliable way of capturing the proper IDProposal, thru VBA, after the record is updated? I'm urging the client to make this a stored procedure ultimately, but I'm not sure they want to take time for that immediately.
Thanks in advance!