Hi Duncs,
You didn't say which version of Access you are using, but the following
Form_Open event procedure works fine in Access 2000/2002/2003 to minimize,
but not hide, the database window. I do not know if this code will work with
the Navigation Pane in Access 2007 (I kind of doubt that it will):
Option Compare Database
Option Explicit
Private Sub Form_Open(Cancel As Integer)
On Error GoTo ProcError
'This code makes sure the Database Window gets minimized
Dim strDocName As String
strDocName = "tblGuests" '---Must use a valid object name here
' Give focus to Database window; select Guest table
DoCmd.SelectObject acTable, strDocName, True
DoCmd.Minimize
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Form_Open..."
Resume ExitProc
End Sub
If you want to completly hide the database window in Access 2000/2002/2003,
then simply select Tools | Startup and uncheck the "Show Database Window"
option. As long as you leave the Special Keys option enabled, you can use the
F11 key to re-display the database window.
Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
"Duncs" wrote:
Aaaagggghhhhh!
I can get this to work at all. I have a form that loads automatically
when my database is opened. What I want to do is, when the form is
loaded / opened, I want the main access window to minimise, so that
the only thing on screen is my form from the database.
I have tried to use both DoCmd.RunCommand acCmdAppMinimize &
DoCmd.RunCommand acCmdWindowHide, neither of which seem to work.
Can anyone help?
TIA
Duncs