Results 1 to 15 of 15
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Application Window (Access 2000)

    I would like my database to open to the designated start form, but without the Access application window showing behind it. Is this possible?

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

    Re: Application Window (Access 2000)

    Yes: select Tools/Startup...

    Select the form you want to be displayed when the database is opened, and uncheck the "Show Database Window" check box.

    You can also set other options in this dialog (for instance whether to show complete menus and toolbars)

    To bypass the startup options (for design purposes), keep the Shift key down while opening the database.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application Window (Access 2000)

    Thanks, but I've already done this part. What I would like is for the Access application window to not display; only my start form. I don't know if there is a way to do that.

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

    Re: Application Window (Access 2000)

    I'm sorry, I misread your question. I thought you meant the database window.
    No, you can't hide the Access application window - your form would be hidden too.

  5. #5
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application Window (Access 2000)

    Actually you can hide the Access Window. It involves API calls.

    Have a look at at http://www.mvps.org/access/api/api0019.htm
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  6. #6
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application Window (Access 2000)

    Put this code inside of a module:

    Option Compare Database
    Option Explicit
    Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
    Dim dwReturn As Long
    Const SW_HIDE = 0
    Const SW_SHOWNORMAL = 1
    Const SW_SHOWMINIMIZED = 2
    Const SW_SHOWMAXIMIZED = 3
    Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
    ByVal nCmdShow As Long) As Long
    Public Function AccessWindow(Optional Procedure As String) As Boolean
    Select Case Procedure
    Case "Hide"
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
    Case "Show"
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
    Case "Minimize"
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
    Case "Switch"
    If IsWindowVisible(hWndAccessApp) = 1 Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
    Else
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
    End If
    End Select
    AccessWindow = IsWindowVisible(hWndAccessApp)
    End Function

    To use this code, you have 5 options:
    AccessWindow "Hide" 'This will hide the Access Window
    AccessWindow "Show" 'This will show the Access Window
    AccessWindow "MInimize" 'This will minimize the Access Window
    AccessWindow "Switch" This will switch the Access Window from visible to hidden or from hidden to visible.
    Finally, you can check the 'status' of the window by just retrieving the value AccessWindow returns (so If AccessWindow Then 'will fire if the Access window is visible)

    One word of caution. You must have at least one visible form on the desktop when you hide the Access window. However, if you don't, there is still hope. I am attaching a little VB .exe I wrote, which will unhide all instances of Access that it finds on your machine. (Very handy when developing with an app that hides the Access Window).
    Attached Files Attached Files

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

    Re: Application Window (Access 2000)

    Bryan,

    I stand corrected. Thanks to you and Drew - I learned something new.

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

    Re: Application Window (Access 2000)

    Me too - I'm impressed. We do something a little different in that we hide all the standard toolbars and menus, change the application title, and maximize the visible form within the application window. I guess it achieves about the same thing in the long run.
    Wendell

  9. #9
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Application Window (Access 2000)

    Very good Drew.
    When would you use this? Maybe if you wanted to start the application and do something behind the scenes invisibly?

    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  10. #10
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application Window (Access 2000)

    Actually, the code on The Access Web is actually the first code I ever used. It took me a while to figure how to even use it, but once I did, there was no looking back, I was on the VBA track! <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

    What I personally needed the code for at that time, was the people I was writing a database for were extremely computer illiterate. The more stuff on the screen, the more confused they were. So by hiding the Access Window, I was able to give them just the forms, with nothing else on the desktop.

    It also adds a little more 'ad hoc' security, since you are effectively preventing a user from doing anything in Access other then what you have put into the forms you display. If the Shift Bypass option is disabled, it is even more effective.

    The only real quirk with hiding that window, is if you need to preview a report. There is no way to do that when the Access Window is hidden.

  11. #11
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Application Window (Access 2000)

    >>So by hiding the Access Window, I was able to give them just the forms, with nothing else on the desktop.<<
    What I found when I did the "hide" was that the Access instance disappeared and left no form on the screen at all. What I did was to open a form that opened another form from a button and the second open form had the "hide" in it's OnOpen event. As I said it hid the entire instance.
    Strange, from what you have described.
    Pat <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  12. #12
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application Window (Access 2000)

    In a round about way, you ran into and solved the form issue.

    In Access 97, you forms (that you want the user to see) must have their popup value to true.

    In Access 2000 (and I assume 2002 (but I can't verify this for 2002)), you must have the Popup AND Modal properties set to true.

  13. #13
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Application Window (Access 2000)

    Thanks Drew, I have A97 so all I had to do is what you said, set the PopUp to Yes.
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  14. #14
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Application Window (Access 2000)

    No problem. Glad to help. Remember to download that .exe I posted. When developing it can come in really handy!

  15. #15
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Application Window (Access 2000)

    I already had downloaded that exe and it has already come in handy.
    Thanks again.
    Pat <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

Posting Permissions

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