|
Private Sub Form_Open(Cancel As Integer)
Dim dbs As Database
Dim rst As Recordset
On Error GoTo Form_Open_Err
DoCmd.SelectObject acForm, "Switchboard", True
DoCmd.Minimize
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
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
執行表的時候會跑出{編譯錯誤:使用者自訂型態尚未定義}
是那裡有錯?謝謝
|
|