此方法須把啟動窗口設置為彈出屬性。所以不適用所有的數據庫。其方法是在啟動窗體的加載屬性中加入如下代碼
DoCmd.RunCommand acCmdAppMinimize'最小化Access窗體
方法二------------------------------
1、定義以下變量
Option Compare Database
Option Explicit
Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
Const WM_SYSCOMMAND As Long = &H112
Const SC_MOVE_MOUSE As Long = &HF012&
Private Declare Function ShowWindow Lib "user32" _
(ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
2、在啟動窗體中鍵入以下代碼並把啟動窗體的彈出屬性設為是
Private Sub Form_Load()
ShowWindow Me.Application.hWndAccessApp, 0
End Sub
要隱藏數據庫窗口,使用以下代碼:
DoCmd.SelectObject acForm, "你的窗體名", True
DoCmd.RunCommand acCmdWindowHide
要最小化數據庫窗口,使用以下代碼:
DoCmd.SelectObject acForm, , True
DoCmd.Minimize