I have used ADO regularly to access my data with not many problems. But I have been having some problems, with this code in particular:

My qryPOPexportCheck has a series of IIf functions. Could that be the cause?
Code:
Public Function ErrorExist() As Boolean
Dim SkuError As Boolean
Dim sSQL As String
Dim varMyErrors As Variant
sSQL = "SELECT Count(qryPOPExportCheck.intOrderNumber) AS CountOfOrder " & _
"FROM qryPOPExportCheck;"
Set cnn = CurrentProject.Connection
'set the recordset
Set rst = New ADODB.Recordset
rst.CursorType = adOpenStatic
rst.LockType = adLockOptimistic
rst.Open sSQL, cnn, adCmdText
varMyErrors = rst.Fields("CountOfOrder")
If varMyErrors > 0 Then
SkuError = True
Else
SkuError = False
End If
rst.Close
Set rst = Nothing
' Close Connection to database
cnn.Close
Set cnn = Nothing
ErrorExist = SkuError
End Function
I am trying to check a series of errors for an imported table, the other modules work perfectly, but I keep on getting the message No Errors in this module, even though there are errors in my error table.???Private Sub CheckErrors_Click()
On Error GoTo Err_CheckErrors_Click
If ErrorExist = True Then
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryPOPExportCheck", acViewNormal, acEdit
DoCmd.OpenQuery "qryPOPImport", acViewNormal, acEdit
DoCmd.SetWarnings True
Else
MsgBox ("No Errors")
End If
'Error handling
Exit_CheckErrors_Click:
Exit Sub
Err_CheckErrors_Click:
MsgBox Err.Description
Resume Exit_CheckErrors_Click
End Sub

My qryPOPexportCheck has a series of IIf functions. Could that be the cause?