Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Invisible screen (Access 2000)

    How can i make the screen of the database invisible during the process?
    During the import of the modules, which i have done with the help of Hans from the Forum,and during the
    updating,my modules are visible to the viewer and i do no want it. I want a black screen, and nothing to be seen
    during the process.I have tried with the command
    DoCmd.Echo False, "Visual Basic code is executing."
    But it does not help. The modules are still seen on the screen.Is there a more powerful method to make my screen invisible during the whole process?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Invisible screen (Access 2000)

    In the "production" version of a database (the one used by the end users) I always hide the database window. This can be set in Tools | Startup..., by clearing the "Show Database Window" check box.

    If you really want to keep the database window visible except during the running of your code, try this. Replace frmMyForm by the name of a form in your database.

    DoCmd.SelectObject acForm, "frmMyForm", True
    ' Hide database window
    RunCommand acCmdWindowHide
    ...
    ...
    DoCmd.SelectObject acForm, "frmMyForm", True
    ' Unhide database window
    RunCommand acCmdWindowUnhide

  3. #3
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Invisible screen (Access 2000)

    If you want to do this with the database window open, you can try using the Windows LockWindowUpdate API function, which reportedly works better than the Application Echo method for hiding screen updating. See attached text file, which is an exported form module (all code runs from form). In this example, all existing modules in current db are deleted first, then all modules from the other database are imported (if this is not what is desired, modify code accordingly). This is the API declaration used:

    Private Declare Function LockWindowUpdate Lib "user32" _
    (ByVal hwndLock As Long) As Long

    To turn off screen updating:

    ' Lock screen updating:
    LockWindowUpdate Application.hWndAccessApp

    Always turn back on when done!:

    ' Unlock screen updating:
    LockWindowUpdate 0&

    This statement should ALWAYS appear in Error Handling "Exit Sub" statements, in case unexpected error occurs, or else application screen may freeze up & stay that way. See attached text file for example of how to use with import function. This worked OK in test, where opened form with database window open and Modules pane visible, then ran code to delete & import modules. The hourglass was visible as code ran (was not able to disable hourglass), but otherwise no visible indication of actions being executed till msgbox invoked when done with import.

    HTH
    Attached Files Attached Files

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Invisible screen (Access 2000)

    Another low tech solution would be to create a plain black form, with a white text message on it.

    Put docmd.maximize in its 'onactivate event", then open the form before the code starts to execute, then close it when it has finished.
    Regards
    John



  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Invisible screen (Access 2000)

    This and your previous threads worry me! It's a highly irregular approach to a problem, and in general when you start modifying VBA code on the fly, it causes ALARM bells to go off in my head - and from comments by others I sense a similar concern. Can you tell us why you want to delete all the modules in a database and then recreate them?
    Wendell

Posting Permissions

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