I am using MS Access 2003.
I have 2 subforms on my page.
The first subform, when a record is inserted, I have to read the ID value of that record and then call some code that will automatically insert records into the 2nd subform. In the first subform the ID value isn't commited to the table until the "AfterUpdate" event. So I put my code in the AfterUpdate event to populate the 2nd subform. This isn't working as there are other fields in my record that the user can update later on and it calls the code in the AfterUpdate event, which I don't want it to fire.
My problem is that I only want to populate the 2nd subform only when an Insert occurs. Keeping in mind, I need the ID value of the first record in order to insert records into the second subform.
How would I only call code when a record is inserted with the ID of the record just inserted?
Thanks
I have 2 subforms on my page.
The first subform, when a record is inserted, I have to read the ID value of that record and then call some code that will automatically insert records into the 2nd subform. In the first subform the ID value isn't commited to the table until the "AfterUpdate" event. So I put my code in the AfterUpdate event to populate the 2nd subform. This isn't working as there are other fields in my record that the user can update later on and it calls the code in the AfterUpdate event, which I don't want it to fire.
My problem is that I only want to populate the 2nd subform only when an Insert occurs. Keeping in mind, I need the ID value of the first record in order to insert records into the second subform.
How would I only call code when a record is inserted with the ID of the record just inserted?
Thanks