Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003

    Cool Unanswered: Make hourglass appear while form loads

    OK, I know the code is docmd.hourglass true and docmd.hourglass false to toggle the hourglass. My problem is, I have a form with 2 subforms, each of which contains several unbound text boxes, and are continuous forms.

    So, while the information is being calculated, the form has a lot of blank fields.

    I'd like to turn on the hourglass when it begins, and turn it off when the form is fully rendered. However, I can get the hourglass started using on open, on gotfocus, etc, but I can't figure out which even to trigger that it has been completed.

    I know it's simple, but I can't get it to work.

    Any ideas?

  2. #2
    Join Date
    Apr 2004
    outside the rim
    Did you try putting the Hourglass False in the On_Current event? On_Current is the last event to fire when a form is opened.

    Although, if the form is unbound, you may not get an On_Current Event, in which case you'd try Activate, which is the 2nd to last event.

  3. #3
    Join Date
    Oct 2003

    Tried that

    Yep. I tried those, they work for starting the hourglass, the problem I am having is getting it to turn off.

    I may just give up, but it seems like I should be able to find a control, or better set a global function that turns hourglass on when "calculating" appears in the bottom left corner of the screan. That would be the best solution.

  4. #4
    Join Date
    Dec 2002
    Préverenges, Switzerland
    your situation is messier than those that i play with, but something that might fly for you...

    discover whatever form happens last (see later) and have something like the following in that last form's code module:

    dim lastLoading as bool
    const lastInterval as integer = 99 'or whatever value you need for the timer, or 0 if not used

    private sub form_load()
    lastLoading = true
    me.timerinterval = 1
    end sub

    private sub form_timer()
    if lastloading
    me.timerinterval = lastInterval
    lastLoading = false
    screen.mousepointer = 0
    'handle whatever you want handled by your normal timer - or nothing
    end sub is later

    if you cannot otherwise determine which subform is loading last, force it! design-time-replace any one of the subform .sourceobjects with an empty (zero bound controls, but any labels you like) form myfrmBlank (instead of the desired myfrmReal desired .sourceobject)

    then in the mother form's code module:

    dim mumLoading as bool
    const mumInterval as integer = 99 'or whatever value you need for the timer, or 0 if not used

    sub form_load()
    mumLoading = true
    me.timerinterval = 1
    end sub

    sub form_timer
    if mumLoading then
    me.timerinterval = mumInterval
    mumLoading = false
    me.theNameOfTheForcedLastSubformControl.SourceObje ct = "myfrmReal"
    ' /// space in the line above is the forum's primitive algo's, not mine
    'do whatever else you wanted to do with the timer - or nothing
    end sub


    after a brief cortico-thalmic pause, i see you are using unbound forms - so you know what the load sequence îs because you wrote the load-and-feed sequence. at the end of your sequence set timerinterval = 1 and iamLoading bool true. in timer set .mousepointer=0 and iAmLoading false.
    the idea being that the timer doesn't tick until _load() has finished executing
    Last edited by izyrider; 08-29-06 at 12:03.
    currently using SS 2008R2

Posting Permissions

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