Hi, I am getting the "Item not found in this collection" error when I reached the "problem here" part below. There is definitely records in the "tSkills Matched a" TABLE. But for some reason it is not working. Or am I mis- interpreting the error message?
Dim dbs As Database
Dim qdf As QueryDef
Dim rst As Recordset
Set qdf = CurrentDb.QueryDefs("Skills Matched a")
qdf.Parameters(0) = strEmployee
qdf.Parameters(1) = strUser
qdf.Execute dbFailOnError
strSQL = "select count(*) as RecCount from [tSkills Matched a];"
'problem here
'***************
Set rst = qdf.OpenRecordset
rst.MoveFirst
intCount = intCount + rst!RecCount
'***************
rst.close
qdf.close
dbs.close
Dim dbs As Database
Dim qdf As QueryDef
Dim rst As Recordset
Set qdf = CurrentDb.QueryDefs("Skills Matched a")
qdf.Parameters(0) = strEmployee
qdf.Parameters(1) = strUser
qdf.Execute dbFailOnError
strSQL = "select count(*) as RecCount from [tSkills Matched a];"
'problem here
'***************
Set rst = qdf.OpenRecordset
rst.MoveFirst
intCount = intCount + rst!RecCount
'***************
rst.close
qdf.close
dbs.close