A
Anthony Viscomi
I receive the "Item not found in this collection " Run-time error when I
execute the following:
Function RunUpdate()
DoCmd.SetWarnings False
Dim dbCurr As DAO.Database
Dim qdfCurr As DAO.QueryDef
Dim sSQL As String
Dim db As Database
Dim parSupplier As Parameter
Dim rs As Recordset
sSQL = "SELECT [Vendor].*"
sSQL = sSQL & " FROM [Vendor];"
Set db = CurrentDb
Set rs = db.OpenRecordset(sSQL, dbOpenDynaset)
With rs
If .RecordCount > 0 Then
.MoveFirst
Do Until .EOF
For Each qdfCurr In db.QueryDefs
Set parSupplier = qdfCurr.Parameters!Supplier
If InStr(qdfCurr.Name, "849 Pull Vendor") = 1 Then
DoCmd.OpenQuery qdfCurr.Name
End If
Next qdfCurr
.MoveNext
Loop
End If
End With
rs.Close
Set rs = Nothing
End Function
Any thoughts?
Thanks!
ANthony
execute the following:
Function RunUpdate()
DoCmd.SetWarnings False
Dim dbCurr As DAO.Database
Dim qdfCurr As DAO.QueryDef
Dim sSQL As String
Dim db As Database
Dim parSupplier As Parameter
Dim rs As Recordset
sSQL = "SELECT [Vendor].*"
sSQL = sSQL & " FROM [Vendor];"
Set db = CurrentDb
Set rs = db.OpenRecordset(sSQL, dbOpenDynaset)
With rs
If .RecordCount > 0 Then
.MoveFirst
Do Until .EOF
For Each qdfCurr In db.QueryDefs
Set parSupplier = qdfCurr.Parameters!Supplier
If InStr(qdfCurr.Name, "849 Pull Vendor") = 1 Then
DoCmd.OpenQuery qdfCurr.Name
End If
Next qdfCurr
.MoveNext
Loop
End If
End With
rs.Close
Set rs = Nothing
End Function
Any thoughts?
Thanks!
ANthony