I have a form with a subform. To save time, I have set several of the main form controls to have default values so that I don't have to edit them most of the time. The subform is often the first thing that I go to when adding records. My main problem is that I will be adding records to the subform and then I realize that the main form is still on a new record. As soon as I change a value in the main form, it creates a record and then all of the data that I had put into the subform is lost. I have thought of two ways to prevent this, but I can't figure out how to get either one to work properly.
Idea 1: Use the OnCurrent event to check if the record is a new record - if so, lock the subform, else unlock it. Problem: Even if I get the main form to create a record number (hence, no longer a new record), it doesn't retrigger the OnCurrent event to unlock the subform. I tried using the form's OnDirty event to fix this, but that didn't work either.
Idea 2: Make it so that when the subform gets updated (probably in some BeforeUpdate event), the main form creates a record. Problem: Not sure how to do this either.
Any another ideas?
Idea 1: Use the OnCurrent event to check if the record is a new record - if so, lock the subform, else unlock it. Problem: Even if I get the main form to create a record number (hence, no longer a new record), it doesn't retrigger the OnCurrent event to unlock the subform. I tried using the form's OnDirty event to fix this, but that didn't work either.
Idea 2: Make it so that when the subform gets updated (probably in some BeforeUpdate event), the main form creates a record. Problem: Not sure how to do this either.
Any another ideas?
Comment