I have a form with one listbox and one subform control.



Listbox contains list of reports. Subform control contains an options form for whichever report is selected in the listbox. None of the forms are bound.

When I select a report, the child subform loads an appropriate class object. The class has a dirty property and an event, which fires of course when the object is dirty.

If the object is dirty, I want to prevent user from selecting a different report, unless the current report is saved first.

I am attempting to use the BeforeUpdate event of the listbox. Seems to work ok, but if I set Cancel = True, the subform is locked unless I hit Escape. I do not want to code a SendKeys.

Does anyone have a nice, clean way of handling such a thing?

Thank you.