+ Reply to Thread
Results 1 to 2 of 2

Object invoked disconnected from its clients.

  1. #1
    Spreadsheet Solutions
    Guest

    Object invoked disconnected from its clients.

    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 ?

    --
    Mark Rosenkrantz
    ---
    Spreadsheet Solutions
    Witkopeend 24
    1423 SN
    Uithoorn, Netherlands
    ---
    E: [email protected]
    W: www.rosenkrantz.nl



  2. #2
    Spreadsheet Solutions
    Guest

    Re: Object invoked disconnected from its clients.

    OK;
    I Found out.
    I had to add Cancel = true

    Thanks anyway.
    Mark.

    "Spreadsheet Solutions" <[email protected]> wrote in message
    news:[email protected]...
    > 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 ?
    >
    > --
    > Mark Rosenkrantz
    > ---
    > Spreadsheet Solutions
    > Witkopeend 24
    > 1423 SN
    > Uithoorn, Netherlands
    > ---
    > E: [email protected]
    > W: www.rosenkrantz.nl
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1