Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Dec 2007
    Posts
    171
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Way to temp. disable Form updates? (form equiv of 'ScreenUpdating = False')

    Hi all,

    Is there a way of temporarily disabling updates to a Windows form that I have created with VBA? BTW, I am working with Word (2003 - 2010).

    For example, I want to change the number and/or position of controls on a Windows form. So in order not to slow down the processing and that the user should not see controls appearing and disappearing I would like to temporarily disable the updates to the form while the controls are moving. After I have completed the move operations, I want to then re-enable the form updating so the the user will see all the updates in their final positions.

    I am aware of a similar display disable capability for the Word document itself: the ScreenUpdating setting, so I am looking for a 'forms equivalent' of 'ScreenUpdating = False'.

    TIA

    -avraham

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    6,388
    Thanks
    208
    Thanked 831 Times in 764 Posts
    Avraham,

    I can't seem to make your problem appear with a small sample problem, see attached. Your problem may lie in code you have attached to OnFocus/LostFocus events, or similiar, for the controls you are moving. You might want to try turning off events. Unfortunately, it seems you cant do this directly in a UserForm module! Here's a possible solution to that problem.
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    861
    Thanks
    0
    Thanked 10 Times in 9 Posts
    Do you .Show the form first? Try loading the form, then manipulate the controls and .Show when finished. If the form is already displayed, you could create a copy of the form (set a variable to hold the form object), and then manipulate the controls and .Show the object (copy of form) when complete. (Hide the original form first.)

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    5,910
    Thanks
    0
    Thanked 89 Times in 85 Posts
    You can also use the LockWindowUpdate api routine to freeze the screen.
    Regards,
    Rory
    Microsoft MVP - Excel.

  5. #5
    2 Star Lounger
    Join Date
    Dec 2007
    Posts
    171
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks, everybody. I will try out the ideas.

    -avraham

Posting Permissions

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