Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report Change causes Pass Through Query to execute on save

Status
Not open for further replies.

ideafixer

Programmer
Nov 21, 2002
70
0
0
US
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top