Object invoked disconnected from its clients.

  • Thread starter Spreadsheet Solutions
  • Start date
S

Spreadsheet Solutions

Dear members;

I have a "password" userform.
The user can enter his password in a textbox and click OK or press Enter.

The OK commandbutton and the Exit event resulting from pressing Enter both
trigger the same procedure Check_Password to evaluate
a users rights.
When I insert a false password, the routine works fine for both clicking the
OK commandbutton and when pressing Enter.
The application closes.
When I insert a valid password and press Enter, the routine works fine as
well.

But, when I insert a valid password and click the OK commandbutton, an error
occurs telling me that
"The object invoked disconnected from its clients".

It seems to me that the routine fails because it fires the same procedure
twice.
Once after Clicking OK and in the same time because of the Exit event.
Can it be because the Exit(ByVal cancel As MSForms.ReturnBoolean) event
always comes before clicking the OK button ?
Does it have to deal with losing or stealing focus ?

If so, how must I solve this ?
 

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