When I run the following code I am getting an error message when I try to edit the record. The reason is the line "If Not rsCont.NoMatch" is coming up False telling me there is a matching record with the prm yet there is not. When I run the query separately putting in the same parameter as the code no records appear in the query. Am I not testing the query correctly? How can I bypass the code if in fact the record is empty?
Dim rsCont As Recordset
Dim intRecordCount As Integer
Set qdf = db.QueryDefs("qryCont")
Set prm = qdf.Parameters(0)
'Set parameter value
prm = File
'Execute QueryDef to produce a recordset
Set rsCont = qdf.OpenRecordset
intRecordCount = 1
If Not rsCont.NoMatch Then
Do
rsCF.MoveFirst
Do Until rsCF.EOF
rsCF.Edit
'Add data
rsCF.Update
rsCF.MoveNext
Loop
intRecordCount = intRecordCount + 1
rsCont.MoveNext
Loop While Not rsCont.EOF
End If
Dim rsCont As Recordset
Dim intRecordCount As Integer
Set qdf = db.QueryDefs("qryCont")
Set prm = qdf.Parameters(0)
'Set parameter value
prm = File
'Execute QueryDef to produce a recordset
Set rsCont = qdf.OpenRecordset
intRecordCount = 1
If Not rsCont.NoMatch Then
Do
rsCF.MoveFirst
Do Until rsCF.EOF
rsCF.Edit
'Add data
rsCF.Update
rsCF.MoveNext
Loop
intRecordCount = intRecordCount + 1
rsCont.MoveNext
Loop While Not rsCont.EOF
End If