Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2007
    Posts
    48

    Unanswered: Shadow of closed Form left on screen

    I have a VBA routine where a database is opened from Excel, and a Form then automatically opens. This form is used by others, but I don't need it sitting on top of the Excel worksheet screen while I run an Access VBA procedure .


    My first step in the Access procedure is to close the form using:

    DoCmd.Close acForm, "myForm"

    ,but there is a greyed area left on the screen where the form was. This disappears when the Access procedure is completed and Excel takes control again.



    Can anyone please advise on how to clear this greyed area of the screen while running in Access?

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Try
    Code:
    DoCmd.DoEvents
    George
    Home | Blog

  3. #3
    Join Date
    Dec 2007
    Posts
    48
    Thanks georgev, but there is no statement in Access 2003 for DoCmd.DoEvents. I tried just the DoEvents, but it made no difference.

    I am still looking for a solution

    regards,
    Jill

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    If there is another form which remains open, try doing a repaint.

    Forms!OtherFormOpen.repaint

    or even a refresh
    Forms!OtherFormOpen.setfocus
    Refresh

    or just a refresh command
    Refresh

    or
    Forms!MyForm.visible = false
    and then after the procedure...
    DoCmd.Close acForm, "myForm"

    or in Excel after the docmd.close acform, "myform"
    .visible = true

    or
    open a blank form after you close myform and close the blank form (long shot but it may work.)

    or
    http://support.microsoft.com/kb/q187745/

    or (and I hate even recommending this but possibly...)
    SendKeys ("{ESC}")
    Last edited by pkstormy; 01-16-08 at 21:55.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    wonder if it could be a graphics driver problem.

    We support a mixed bag of PC's, a few of which have ATI Radeon cards which seem to have real issues on refresh, repaint and similar instructions. Of course its neither an ATI problem, or a OS problem or an application.. its always an SEP (Someone Else's Problem) or a NMP (Not My Problem)

Posting Permissions

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