Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    173

    Unanswered: force a form to show before code executes

    I have a piece of code that is supposed to show a form first and then execute some code and then take down the code. Problem is the code executes and does its job well, but the form doesn't fully display. It paints the borders but not the forms contents. Its in Access 2K. Is there a way to force the screen to repaint so the form fully shows and then the code executes? TIA

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    The simple hack would be to have the code execution sleep for 1/2 second or so. It's not that it isn't executing properly, your code is just outrunning the redraw.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Nov 2003
    Location
    Sussex, England
    Posts
    404
    Have you tried DoEvents. You could open the form as a Dialogue form, but then the user would have to click something, so that might not work.

    If you try to delay code execution I would suggest soemthing like DoEvents in a loop.

  4. #4
    Join Date
    Apr 2004
    Posts
    173
    Actually I inserted a DoEvents before the loop to perform the code and it now works like a charm. Although I will be using that sleep API for something else. Thanks for the help.

  5. #5
    Join Date
    Jul 2004
    Location
    South Dakota
    Posts
    267
    I have also had a similar problem. I just set the forms TimerInterval property to 1 and then in the Timer sub after the first time it fired I ran the code. Not the best solution but it works.

    Canupus

Posting Permissions

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