对象变量未定义
以下程序编译时候出现“实时错误91,对象变量未定义”Sub Form_Load()
Dim tabname As String
Dim TabNameC As String
Dim SQL As String
Call Set_FieldName
tabname = "QuXYS"
Call TabExist_Check(tabname)
If Tab_Check <> 1 Then
Call AppendTab1(tabname)
End If
'
Call Set_FieldNameC
TabNameC = "QuXYSCG"
Call TabExist_Check(TabNameC)
If Tab_Check <> 1 Then
Call AppendTab2(TabNameC)
End If
Data1.DatabaseName = DbName
Data1.RecordSource = tabname
Data1.Refresh
调试时光标在此提示错误发生:
If Data1.Recordset.RecordCount <> 0 Then
Data1.Recordset.MoveLast
Data1.Recordset.MoveFirst
End If
DBCount1 = Data1.Recordset.RecordCount
Call Grid1_ini
Grid1.Row = 1
Grid1.Col = 1
Frame1.Caption = "数据共 " + Str$(Data1.Recordset.RecordCount) + " 行"
Frame2.Caption = "数据共 " + Str$(Data1.Recordset.RecordCount) + " 行"
Screen.MousePointer = 0
End Sub
Sub Form_Activate()
If Text1(0).Visible = True Then
Text1(0).SetFocus
End If
End Sub