BOster
Legendary Poster
How do you stop a form from closing when the OK button is pressed aside from setting an error on a control?
Scenario:
I have a powerform parent that has several subforms one of which is an editable grid. When the user moves off a line in the grid, data validation runs and throws errors in the grid, etc. However, nothing stops the user from pressing the OK button on the parent form and closing the form. If the grid was on the parent form, then the error(s) would prevent the form from closing, but since the error is on a child subform, nothing stops the user from closing the parent form.
I am able to use the subform system function on the parent to get the error count on the subform but once I have that error count the only way I can prevent the parent form from closing is to throw an error on the OK button of the parent... which is kinda ugly. It would be nice to get the error count of the child subform and then simply stop the OK.post event and prevent the parent form from closing and firing all the associated form closing events.
Scenario:
I have a powerform parent that has several subforms one of which is an editable grid. When the user moves off a line in the grid, data validation runs and throws errors in the grid, etc. However, nothing stops the user from pressing the OK button on the parent form and closing the form. If the grid was on the parent form, then the error(s) would prevent the form from closing, but since the error is on a child subform, nothing stops the user from closing the parent form.
I am able to use the subform system function on the parent to get the error count on the subform but once I have that error count the only way I can prevent the parent form from closing is to throw an error on the OK button of the parent... which is kinda ugly. It would be nice to get the error count of the child subform and then simply stop the OK.post event and prevent the parent form from closing and firing all the associated form closing events.