I have a table that I need to update records related to the ID value when a new record is inserted.
When a new record is created a field called 'InvoiceID' stores (via parameter passing) a value. That value might be used multiple times in the table (for example, this is a Payments table linked to an Invoice table. The InvoiceID (unique- one) from the Invoice table is stored (many) in the Payments table for each Payment record for the same invoice. So for 5 Payments records there might be InvoiceID=2 used 3 times and InvoiceID=4 used 2) .
When a new record is inserted to the Payments table I need the trigger to look up all other records in that same Payments table with the same InvoiceID and update them. I tried using the Where tabs with Field=InvoiceID Equals Field=InvoiceID but the trigger doesn't work. If I manually put in a number for the 2nd InvoiceID to test it the trigger does work. So the issue is the trigger being able to match existing record's InvoiceID value with the submitted/inserted record's InvoiceID value and update them.
Does anyone know how/if this can be done? It seems like it should be simple so I must be missing something basic..
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
DesiLogi
Hi,
I have a table that I need to update records related to the ID value when a new record is inserted.
When a new record is created a field called 'InvoiceID' stores (via parameter passing) a value. That value might be used multiple times in the table (for example, this is a Payments table linked to an Invoice table. The InvoiceID (unique- one) from the Invoice table is stored (many) in the Payments table for each Payment record for the same invoice. So for 5 Payments records there might be InvoiceID=2 used 3 times and InvoiceID=4 used 2) .
When a new record is inserted to the Payments table I need the trigger to look up all other records in that same Payments table with the same InvoiceID and update them. I tried using the Where tabs with Field=InvoiceID Equals Field=InvoiceID but the trigger doesn't work. If I manually put in a number for the 2nd InvoiceID to test it the trigger does work. So the issue is the trigger being able to match existing record's InvoiceID value with the submitted/inserted record's InvoiceID value and update them.
Does anyone know how/if this can be done? It seems like it should be simple so I must be missing something basic..
Link to comment
Share on other sites
14 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.