I’m looking for a forms trick.
I’ve got a main and sub form. Both forms have a lot of code and a “New” and “Save” button.
The Save button in the main form assigns an ID and saves the record (along with a lot of other stuff). The main form needs to have the ID assigned and record saved before the sub form can proceed with its new records.
If the main form hasn’t yet been saved, and the user clicks in the sub form (anywhere or any control), the BeforeUpdate for the main form runs and undoes the main form record (as saves are explicit). The sub form then crashes with code logic errors.
So, I’m looking for a way to disable the sub form between the time the new button is pressed in the main form and the save button is pressed. It would be like forms(“subname”).enabled = false, but there isn’t such a thing (as far as I know). I can't just disable all the controls, as just pressing in the detail portion of the sub will also run the main's BeforeUpdate.
Any ideas?