|
DoCmd.SelectObject acForm, "你的窗体名", True
DoCmd.RunCommand acCmdWindowHide
数据库窗体的名称是什么?
哪位给一段完整的代码呵,比如下面
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.
Dim dbs As Database
Dim rst As Recordset
On Error GoTo Form_Open_Err
' Minimize the database window.
DoCmd.SelectObject acForm, "Switchboard", True
DoCmd.Minimize
' Make sure we have company information
DoCmd.Hourglass False
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("我的公司信息")
If rst.RecordCount = 0 Then
rst.AddNew
rst![地址] = Null
rst.Update
MsgBox "在使用此应用程序之前,您需要输入您的公司名称,地址和相关信息。"
''' DoCmd.OpenForm "我的公司信息", , , , , acDialog
End If
rst.Close
dbs.Close
' Move to the switchboard page that is marked as the default.
Me.Filter = "[ItemNumber] = 0 AND [Argument] = 'Default' "
Me.FilterOn = True
Form_Open_Exit:
Exit Sub
Form_Open_Err:
MsgBox Err.Description
Resume Form_Open_Exit
End Sub |
|