|
我是今天才学的ACCESS,请问~可以帮我解一下下面的代码吗~我有点看不懂~谢了
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, "切换面板", 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] = '默认' "
Me.FilterOn = True
Form_Open_Exit:
Exit Sub
Form_Open_Err:
MsgBox Err.Description
Resume Form_Open_Exit
End Sub
如可以的话~帮说明一下每一句话的作用~ |
|