E
Eka1618
Hello,
I am trying to loop through a predefined query to see if all records have a
"STATUS" = "COMPLETE" and return true (through a function) if they are all
completed. I am getting an error that my parameter (item) not found in my
collection.
Here is my code:
Public Function archival() As Boolean
Dim db As Database
Dim rs As dao.Recordset
Dim qdf As dao.QueryDef
Set db = CurrentDb()
Set qdf = db.QueryDefs("qryReady4Archive")
'ERROR OCCURS HERE!
qdf.Parameters("REQUEST_NO") = Me.REQUEST_NO.Value
Set rs = qdf.OpenRecordset
archival = True
While Not rs.EOF
If rs(1).Value <> "COMPLETE" Then
archival = False
rs.MoveNext
End If
Wend
End Function
This is the SQL of my query:
SELECT tblQueue.STATUS, tblQueue.REQUEST_NO FROM tblQueue;
I am not sure where I am going wrong. If anyone has any suggestion, please
let me know. Thank You!
~Erica~
I am trying to loop through a predefined query to see if all records have a
"STATUS" = "COMPLETE" and return true (through a function) if they are all
completed. I am getting an error that my parameter (item) not found in my
collection.
Here is my code:
Public Function archival() As Boolean
Dim db As Database
Dim rs As dao.Recordset
Dim qdf As dao.QueryDef
Set db = CurrentDb()
Set qdf = db.QueryDefs("qryReady4Archive")
'ERROR OCCURS HERE!
qdf.Parameters("REQUEST_NO") = Me.REQUEST_NO.Value
Set rs = qdf.OpenRecordset
archival = True
While Not rs.EOF
If rs(1).Value <> "COMPLETE" Then
archival = False
rs.MoveNext
End If
Wend
End Function
This is the SQL of my query:
SELECT tblQueue.STATUS, tblQueue.REQUEST_NO FROM tblQueue;
I am not sure where I am going wrong. If anyone has any suggestion, please
let me know. Thank You!
~Erica~