A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

The OpenReport Action was Canceled problem.



 
 
Thread Tools Display Modes
  #1  
Old October 30th, 2007, 05:05 PM posted to microsoft.public.access.reports
ToniS
external usenet poster
 
Posts: 31
Default The OpenReport Action was Canceled problem.


I have a report with a sub report on it, when I run the report in the .ADP
application the report works fine, when I create an .ADE and run the same
report it does not run, I get the following error: "The OpenReport action
was canceled" After further research I found out that the below code will
only work for .ADP, what would be the work around to have this work for an
..ADE?

strSQL = "SELECT ......FROM AView WHERE ShowId = '" & pubShowID & "'"

DoCmd.OpenReport "ExhReport_SubReportRepGroups", acViewDesign
Set subRptrepGroups = Reports!ExhReport_SubReportRepGroups
subRptrepGroups.RecordSource = strSQL
DoCmd.Close acReport, "ExhReport_SubReportRepGroups", acSaveYes


I basically have a subreport with a select statement on a view that I would
like to have a where clause based on ShowID.

I have tried setting the subreport Recordsource and I get the following
error: "You can't set the RecordSet Property in print preview or after
printing has started"

I am currently using A2003

Thanks
ToniS


  #2  
Old October 30th, 2007, 05:47 PM posted to microsoft.public.access.reports
Klatuu
external usenet poster
 
Posts: 7,074
Default The OpenReport Action was Canceled problem.

Problem starts he
DoCmd.OpenReport "ExhReport_SubReportRepGroups", acViewDesign

You can't use design view in an ade or mde.

A solution would be to create a stored query from your SQL and have your
report reference that.
--
Dave Hargis, Microsoft Access MVP


"ToniS" wrote:


I have a report with a sub report on it, when I run the report in the .ADP
application the report works fine, when I create an .ADE and run the same
report it does not run, I get the following error: "The OpenReport action
was canceled" After further research I found out that the below code will
only work for .ADP, what would be the work around to have this work for an
.ADE?

strSQL = "SELECT ......FROM AView WHERE ShowId = '" & pubShowID & "'"

DoCmd.OpenReport "ExhReport_SubReportRepGroups", acViewDesign
Set subRptrepGroups = Reports!ExhReport_SubReportRepGroups
subRptrepGroups.RecordSource = strSQL
DoCmd.Close acReport, "ExhReport_SubReportRepGroups", acSaveYes


I basically have a subreport with a select statement on a view that I would
like to have a where clause based on ShowID.

I have tried setting the subreport Recordsource and I get the following
error: "You can't set the RecordSet Property in print preview or after
printing has started"

I am currently using A2003

Thanks
ToniS


  #3  
Old October 30th, 2007, 05:57 PM posted to microsoft.public.access.reports
ToniS
external usenet poster
 
Posts: 31
Default The OpenReport Action was Canceled problem.

do you mean write a Stored Procedure? If this is true, I have tried that and
ran into problems.. Creating the SP for the subReport part was easy, the part
where I ran into problems was trying to pass a parmater for the SP for the
subreport. How do I go about doing that?

Thanks

"Klatuu" wrote:

Problem starts he
DoCmd.OpenReport "ExhReport_SubReportRepGroups", acViewDesign

You can't use design view in an ade or mde.

A solution would be to create a stored query from your SQL and have your
report reference that.
--
Dave Hargis, Microsoft Access MVP


"ToniS" wrote:


I have a report with a sub report on it, when I run the report in the .ADP
application the report works fine, when I create an .ADE and run the same
report it does not run, I get the following error: "The OpenReport action
was canceled" After further research I found out that the below code will
only work for .ADP, what would be the work around to have this work for an
.ADE?

strSQL = "SELECT ......FROM AView WHERE ShowId = '" & pubShowID & "'"

DoCmd.OpenReport "ExhReport_SubReportRepGroups", acViewDesign
Set subRptrepGroups = Reports!ExhReport_SubReportRepGroups
subRptrepGroups.RecordSource = strSQL
DoCmd.Close acReport, "ExhReport_SubReportRepGroups", acSaveYes


I basically have a subreport with a select statement on a view that I would
like to have a where clause based on ShowID.

I have tried setting the subreport Recordsource and I get the following
error: "You can't set the RecordSet Property in print preview or after
printing has started"

I am currently using A2003

Thanks
ToniS


  #4  
Old October 30th, 2007, 06:01 PM posted to microsoft.public.access.reports
Klatuu
external usenet poster
 
Posts: 7,074
Default The OpenReport Action was Canceled problem.

I am not sure. I am a bit out of my element here, but I think you might be
able to do it with a pass through query.
--
Dave Hargis, Microsoft Access MVP


"ToniS" wrote:

do you mean write a Stored Procedure? If this is true, I have tried that and
ran into problems.. Creating the SP for the subReport part was easy, the part
where I ran into problems was trying to pass a parmater for the SP for the
subreport. How do I go about doing that?

Thanks

"Klatuu" wrote:

Problem starts he
DoCmd.OpenReport "ExhReport_SubReportRepGroups", acViewDesign

You can't use design view in an ade or mde.

A solution would be to create a stored query from your SQL and have your
report reference that.
--
Dave Hargis, Microsoft Access MVP


"ToniS" wrote:


I have a report with a sub report on it, when I run the report in the .ADP
application the report works fine, when I create an .ADE and run the same
report it does not run, I get the following error: "The OpenReport action
was canceled" After further research I found out that the below code will
only work for .ADP, what would be the work around to have this work for an
.ADE?

strSQL = "SELECT ......FROM AView WHERE ShowId = '" & pubShowID & "'"

DoCmd.OpenReport "ExhReport_SubReportRepGroups", acViewDesign
Set subRptrepGroups = Reports!ExhReport_SubReportRepGroups
subRptrepGroups.RecordSource = strSQL
DoCmd.Close acReport, "ExhReport_SubReportRepGroups", acSaveYes


I basically have a subreport with a select statement on a view that I would
like to have a where clause based on ShowID.

I have tried setting the subreport Recordsource and I get the following
error: "You can't set the RecordSet Property in print preview or after
printing has started"

I am currently using A2003

Thanks
ToniS


  #5  
Old October 30th, 2007, 10:04 PM posted to microsoft.public.access.reports
Rick Brandt
external usenet poster
 
Posts: 4,354
Default The OpenReport Action was Canceled problem.

ToniS wrote:
do you mean write a Stored Procedure? If this is true, I have tried
that and ran into problems.. Creating the SP for the subReport part
was easy, the part where I ran into problems was trying to pass a
parmater for the SP for the subreport. How do I go about doing that?


Just change the RecordSource in the Open event of each report. That does
not require that you use design view. You will need a way to pass the
information to the report by pulling it from a form, a public variable or by
using OpenArgs, but other than that the code is similar to what you are
doing now.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.