I'm using Access 2007
I have a table that contains transaction records from a bound form.
When the user enters a certain type of transaction, I create a corresponding transaction in the after insert event.
Example
User record - tranId = 1, tranAmt = 10, tranType = DISB, tranAssocID = 0
My record - tranId = 2, tranAmt = 10, tranType = RECV, tranAssocID = 1
When the user deletes a record, I want to delete my corresponding record using the tranAssocID ( delete * from tran_tbl where tranAssocID = (the tranID of the user's record)
Problem:
1) I don't know how to save the tranID of the users record
2) I don't know how to reference the saved tranID in the delete statement.
I'm using the before delete confirm event to try to save the users tranID to no avail.
I'm using the after delete confirm to delete my record in a case statement - acDeleteOK
Any help you can give will be appreciated.
I tried to save the value of the ID in the form (Me.tid) to a public long variable, a hidden field on the form, and a temporary variable to no avail.
I have a table that contains transaction records from a bound form.
When the user enters a certain type of transaction, I create a corresponding transaction in the after insert event.
Example
User record - tranId = 1, tranAmt = 10, tranType = DISB, tranAssocID = 0
My record - tranId = 2, tranAmt = 10, tranType = RECV, tranAssocID = 1
When the user deletes a record, I want to delete my corresponding record using the tranAssocID ( delete * from tran_tbl where tranAssocID = (the tranID of the user's record)
Problem:
1) I don't know how to save the tranID of the users record
2) I don't know how to reference the saved tranID in the delete statement.
I'm using the before delete confirm event to try to save the users tranID to no avail.
I'm using the after delete confirm to delete my record in a case statement - acDeleteOK
Any help you can give will be appreciated.
I tried to save the value of the ID in the form (Me.tid) to a public long variable, a hidden field on the form, and a temporary variable to no avail.