views:

324

answers:

4

Just wondering, is there a way to tell access to only display the forms/reports without displaying the access window itself (the "shell" window that the access forms populate inside of).

just wondering.

+1  A: 

If you create an MDE and run it under the Access Runtime, it will execute your program stripped of (most, if not all of) the Access GUI.

This is by design. The Access Runtime is intended to allow you to distribute a copy of your application, while depriving your users of the regular Access trappings.

Robert Harvey
Even with an MDE you still have the parent window BUT the MDE does give you some extra's in it that make it very worthwhile.
klabranche
Good suggestion on the Access Runtime. It will strip it down even more. :)
klabranche
Note that there are all kinds of things you should know before deplying an app using the runtime. Such as ensuring you have a startup macro or form, the right mouse click menu no longer works, and you propably want to create your own abbreviated toolbar menus. See See my Microsoft Access ODE or MOD Runtime Installation Troubles Tips page at http://www.granite.ab.ca/access/runtime.htm.
Tony Toews
Doesn't the right click continue to work when you've defined shortcut menus for your objects?
David-W-Fenton
+1  A: 

No. Access is a classic Multiple Document Interface (MDI) where all the child windows are inside a parent window.

However, Access does have a lot of ways you can change the Parent Window Menu's and Toolbars. You can create your own menu and toolbar layouts that only have what you want in them. Google creating menu bars and toolbars in Access and it should point you in the right direction.

EDIT:

JP nailed it.... My brain forgot that little nugget....

klabranche
+6  A: 

Yes, you can. See "Setting Startup Options" from Basics for Building Microsoft Office Access 2003 Runtime-Based Solutions.

You can use the Startup dialog box to specify the following:

  • Whether or not the Database window should be displayed on startup.
JP Alioto
+1 I was trying to remember the exact setting. It's been awhile.
Robert Harvey
Ah... I had completely spaced that! :)
klabranche
+4  A: 

To do so, I take advantage of a piece of code written by some clever guys and available on the net (I think it was originaly written by Terry Kreft?) and refering to some windows API.

I have first this:

Declare Function apiShowWindow Lib "user32" _
          Alias "ShowWindow" (ByVal hwnd As Long, _
          ByVal nCmdShow As Long) As Long

Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3

and that

Function fSetAccessWindow(nCmdShow As Long)
      'Usage Examples
      'Maximize window:
      '       ?fSetAccessWindow(SW_SHOWMAXIMIZED)
      'Minimize window:
      '       ?fSetAccessWindow(SW_SHOWMINIMIZED)
      'Hide window:
      '       ?fSetAccessWindow(SW_HIDE)
      'Normal window:
      '       ?fSetAccessWindow(SW_SHOWNORMAL) 

      Dim loX  As Long
      Dim loForm As Form

   On Error Resume Next
   Set loForm = Screen.ActiveForm
   If Err <> 0 Then 'no Activeform
       If nCmdShow = SW_HIDE Then
           MsgBox "Cannot hide Access unless a form is on screen"
       Else
           loX = apiShowWindow(hWndAccessApp, nCmdShow)
           Err.Clear
       End If
   Else
       If nCmdShow = SW_SHOWMINIMIZED And loForm.Modal = True Then
           MsgBox "Cannot minimize Access with this form on screen:" & (loForm.Caption + " ")
       Else
           If nCmdShow = SW_HIDE And loForm.PopUp <> True Then
               MsgBox "Cannot hide Access with this form on screen:" & (loForm.Caption + " ")
           Else
               loX = apiShowWindow(hWndAccessApp, nCmdShow)
           End If
       End If
   End If
   fSetAccessWindow = (loX <> 0)

End Function

When starting my program, I will then call the function this way

'funtion is called by autoexec Macro'
...
fSetAccessWindow (SW_HIDE)
...
DoCmd.OpenForm my_Startup_Form
Forms(my_Startup_Form).Controls(my_Active_Control).SetFocus

The screen will 'flicker' a little bit, and the main window will appear briefly, then disappear. My focussed window will then be displayed alone.

Philippe Grondier
Does this still work in Access 2007? Any chance of a link to your source so I can get some more info on it?
A. Scagnelli
You really should include the URL of your source when you're using someone else's code. The URL for this is: http://www.mvps.org/access/api/api0019.htm , which is easily enough found by Googling the name of the function.
David-W-Fenton
Thanks David. I was planning to do that but I got caught by something uuuuuuurgeeeeeent (according to others!)
Philippe Grondier
A. , I guess it still woks in Access 2007, as it is related to Windows, not Office
Philippe Grondier