testing1two
Registered User.
- Local time
- Today, 06:45
- Joined
- Nov 11, 2014
- Messages
- 10
Hi, I have the following Visual Basic code which I am using to dynamically pass the parameters "SAFP" and date 10/31/2014 to the query:
When I run the query, i get the error "Item not Found in this collection"
Option Compare Database
'------------------------------------------------------------
' Run_Risk_Assessment_Report
'
'------------------------------------------------------------
'Original macro code
Function Run_Risk_Assessment_Report()
On Error GoTo Run_Risk_Assessment_Report_Err
Dim dbs As DAO.Database
Dim test1 As DAO.QueryDef
Dim qdf As DAO.QueryDef
Set dbs = CurrentDb
Set qdf = dbs.QueryDefs("A) Rpt Qry - Select Data Master")
DoCmd.SetWarnings False
' Clear out the Master Report Table
DoCmd.OpenQuery "Clear out the Master Report Table", acViewNormal, acEdit
' Run the query to make / update the Main Report Table
DoCmd.OpenQuery "A) Rpt Qry - Select Data Master", acViewNormal, acEdit
' update the grand totals
DoCmd.OpenQuery "Update Grand Total", acViewNormal, acEdit
' update the percentages in the Main Report Table
DoCmd.OpenQuery "Update Percentages in Report Master Report Table", acViewNormal, acEdit
' Runs the report
DoCmd.OpenReport "Risk Assessment Summary", acViewNormal, "", "", acNormal
Run_Risk_Assessment_Report_Exit:
Exit Function
Run_Risk_Assessment_Report_Err:
MsgBox Error$
Resume Run_Risk_Assessment_Report_Exit
End Function
When I run the query, i get the error "Item not Found in this collection"
Last edited: