Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Hourglass doesn't display when code called from toolbar

Discussion in 'Information Technology' started by Jerry Porter, Jul 28, 2006.

  1. Jerry Porter

    Jerry Porter
    Expand Collapse
    Guest

    I have code in an Access 2002 mdb that extracts SQL Server data for a
    form. When the code is triggered by clicking a button on a form, the
    hourglass displays properly. But when the same code is triggered by a
    toolbar control (combo box or button), the hourglass does not display.

    - If the code is interrupted by a break point or a MsgBox, then the
    hourglass comes on.

    - DoEvents does not help.

    Any ideas?

    Thanks,

    Jerry
     
  2. Loading...


  3. Jeff Boyce

    Jeff Boyce
    Expand Collapse
    Guest

    Jerry

    If you want the hourglass to display, you can explicitly command it to do so
    with something like:
    DoCmd.Hourglass True
    and
    DoCmd.Hourglass False

    Regards

    Jeff Boyce
    Microsoft Office/Access MVP

    "Jerry Porter" <jerryp@personablepc.com> wrote in message
    news:1148423179.790742.41520@j73g2000cwa.googlegroups.com...
    >I have code in an Access 2002 mdb that extracts SQL Server data for a
    > form. When the code is triggered by clicking a button on a form, the
    > hourglass displays properly. But when the same code is triggered by a
    > toolbar control (combo box or button), the hourglass does not display.
    >
    > - If the code is interrupted by a break point or a MsgBox, then the
    > hourglass comes on.
    >
    > - DoEvents does not help.
    >
    > Any ideas?
    >
    > Thanks,
    >
    > Jerry
    >
     
  4. Jerry Porter

    Jerry Porter
    Expand Collapse
    Guest

    Jeff,

    Sorry I wasn't clear. My code does use "DoCmd.Hourglass True" to
    display the hourglass. As I explained, it works sometimes, but not
    others.

    Jerry
     
  5. Jerry Porter

    Jerry Porter
    Expand Collapse
    Guest

    It appears the hourglass problem only occurs if the code is called from
    a combo box on the toolbar. I thought I had tested with a button
    earlier.

    I duplicated this in a new database with a toolbar combo box that
    called a simple function that sets the hourglass, waits 3 seconds, and
    turns the hourglass off. When called from the combo box, the hourglass
    does not display. When called from a form button or toolbar button, it
    works fine.

    I've used
    Debug.Print Screen.MousePointer
    in the procedure to display the value of the pointer. It does show a
    value of 11 (the code for the hourglass pointer).
     
  6. david epsom dot com dot au

    david epsom dot com dot au
    Expand Collapse
    Guest

    The hourglass will only display when Access gets focus.
    The toolbar is not Access - it is an Office component.
    They've obviously tried to work around this problem, but
    it occasionally comes up in one form or another.

    Also, this kind of problem sometimes depends on which
    version of windows, and even on which video driver you
    have installed.

    You can try
    application.screen.mousepointer,
    application.RefreshTitleBar
    application.CommandBars.ReleaseFocus
    and any of the set focus methods.

    (david)


    "Jerry Porter" <jerryp@personablepc.com> wrote in message
    news:1148423179.790742.41520@j73g2000cwa.googlegroups.com...
    >I have code in an Access 2002 mdb that extracts SQL Server data for a
    > form. When the code is triggered by clicking a button on a form, the
    > hourglass displays properly. But when the same code is triggered by a
    > toolbar control (combo box or button), the hourglass does not display.
    >
    > - If the code is interrupted by a break point or a MsgBox, then the
    > hourglass comes on.
    >
    > - DoEvents does not help.
    >
    > Any ideas?
    >
    > Thanks,
    >
    > Jerry
    >
     
  7. Jerry Porter

    Jerry Porter
    Expand Collapse
    Guest

    Thank you David!!

    Of the four suggestions, only CommandBars.ReleaseFocus worked.

    >From your explanation, I thought AppActivate would work to give Access

    the focus, but it didn't work.

    I'm delighted to have this annoying detail solved.

    Jerry
     
  8. david epsom dot com dot au

    david epsom dot com dot au
    Expand Collapse
    Guest

    :~) Multiple suggestions only when I don't know the answer.
    Thanks for the information :~)

    (david)

    "Jerry Porter" <jerryp@personablepc.com> wrote in message
    news:1148577989.432133.254700@u72g2000cwu.googlegroups.com...
    > Thank you David!!
    >
    > Of the four suggestions, only CommandBars.ReleaseFocus worked.
    >
    >>From your explanation, I thought AppActivate would work to give Access

    > the focus, but it didn't work.
    >
    > I'm delighted to have this annoying detail solved.
    >
    > Jerry
    >
     

Share This Page