BrianBeck
asked on
"Unable to unload within this context" error (VB)
Dear Gurus
My VB6 app has a number of child forms. In almost all, the user clicks Cancel to exit and return to the main form. However, in a new just-created form, I need the code to automatically unload the form at the end of a process. When I attempt to do this I receive:
"Unable to unload within this context"
I've tried other's suggestions, eg, activating a 50mS timer. Placing an 'unload me' in that procedure also returned the same effort. Even calling a separate routine that unloads the form doesn't help.
Can you help please?
My VB6 app has a number of child forms. In almost all, the user clicks Cancel to exit and return to the main form. However, in a new just-created form, I need the code to automatically unload the form at the end of a process. When I attempt to do this I receive:
"Unable to unload within this context"
I've tried other's suggestions, eg, activating a 50mS timer. Placing an 'unload me' in that procedure also returned the same effort. Even calling a separate routine that unloads the form doesn't help.
Can you help please?
ASKER
Note: the last user acrtion is the selection of a drop-down combo box. From what I've seen, it seems that VB doesn't permit unload routines from combo box event handlers. But, the event handler calls a separate routine that unloads the form.
Puzzling, and I'm keen to see a solution,
Puzzling, and I'm keen to see a solution,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dear M. Raja
Thanks - brilliantly simple!
Brian
Thanks - brilliantly simple!
Brian
ASKER