Cancel a listbox selection

Joined
Oct 26, 2009
Messages
1
Reaction score
0
Hi all, this is something I've had trouble understanding, despite years of not understanding it...

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? Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top