I have the following code:
========= Start Code ==========
Dim rpt As Report
Dim ctl As Control
Dim Test As String
Test = ReportName_Actual
'DoCmd.OpenReport DLookup("[ReportName]", "tbl_reports", "[ID] = " & pubreport), acViewDesign
DoCmd.OpenReport ReportName_Actual, acViewDesign
Set rpt = Reports(DLookup("[ReportName]", "tbl_reports", "[ID] = " & pubreport))
rpt.Controls("ReportType").ControlSource = "='" & ReportType & "'"
rpt.Controls("ReportName_Display").ControlSource = "='" & ReportName_Display & "'"
rpt.Controls("ReportName_Actual").ControlSource = "='" & ReportName_Actual & "'"
rpt.Controls("ReportName_ID").ControlSource = "='" & ReportName_ID & "'"
rpt.Controls("StartDate").ControlSource = "='" & ParamStartDate & "'"
rpt.Controls("EndDate").ControlSource = "='" & ParamEndDate & "'"
DoCmd.Close acReport, DLookup("[ReportActualName]", "dbo_reports", "[ID] = " & pubreport), acSaveYes
DoCmd.Close acReport, ReportName_Actual, acSaveYes
========= End Code =================
Basically, this code switches some text boxes that are used for reporting purposes. I have the report hooked to a pass through query. When the report saves, it takes a while because it confirms the record source with the pass through query. Is there any way to get around the report checking against the record source?
This is part of a batch system, so I cannot remove the ODBC connection string and just hit cancel when the report verifies the query. Some how I need to cancel the query from connecting to the stored procedure on save through code.... any ideas?
========= Start Code ==========
Dim rpt As Report
Dim ctl As Control
Dim Test As String
Test = ReportName_Actual
'DoCmd.OpenReport DLookup("[ReportName]", "tbl_reports", "[ID] = " & pubreport), acViewDesign
DoCmd.OpenReport ReportName_Actual, acViewDesign
Set rpt = Reports(DLookup("[ReportName]", "tbl_reports", "[ID] = " & pubreport))
rpt.Controls("ReportType").ControlSource = "='" & ReportType & "'"
rpt.Controls("ReportName_Display").ControlSource = "='" & ReportName_Display & "'"
rpt.Controls("ReportName_Actual").ControlSource = "='" & ReportName_Actual & "'"
rpt.Controls("ReportName_ID").ControlSource = "='" & ReportName_ID & "'"
rpt.Controls("StartDate").ControlSource = "='" & ParamStartDate & "'"
rpt.Controls("EndDate").ControlSource = "='" & ParamEndDate & "'"
DoCmd.Close acReport, DLookup("[ReportActualName]", "dbo_reports", "[ID] = " & pubreport), acSaveYes
DoCmd.Close acReport, ReportName_Actual, acSaveYes
========= End Code =================
Basically, this code switches some text boxes that are used for reporting purposes. I have the report hooked to a pass through query. When the report saves, it takes a while because it confirms the record source with the pass through query. Is there any way to get around the report checking against the record source?
This is part of a batch system, so I cannot remove the ODBC connection string and just hit cancel when the report verifies the query. Some how I need to cancel the query from connecting to the stored procedure on save through code.... any ideas?