I am trying to check if a query exists. Here is my code.
I get a runtime error: Object variable or with block variable not set
Private Sub CmdCheck_Click()
Dim db As Database
Dim qry As QueryDef
Dim i As Integer
For Each qry In db.QueryDefs
If qry.Name = "qryTempcat" Then
i = 1
End If
Next qry
End Sub
Thanks
I get a runtime error: Object variable or with block variable not set
Private Sub CmdCheck_Click()
Dim db As Database
Dim qry As QueryDef
Dim i As Integer
For Each qry In db.QueryDefs
If qry.Name = "qryTempcat" Then
i = 1
End If
Next qry
End Sub
Thanks