472,358 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,358 software developers and data experts.

Referring to a subreport (Error 2455)

Hi,

I have a Report with a subreport, and I want to assign a value to the
control source of a control on the subreport depending on the value
given by the user in a separate form. Based on advice from the online
help and from other posts in this group, I wrote the following code
which is called on the On Open even of the main report. I have tried
several variations on this, which always result in the same error
message-

Run-time error 2455 'You entered an expression that has an invalid
reference to the property Form/Report.'

I have checked that the subreport name I am referring to is the
control name that appears in the main report and not the actual name
of the subreport.

THE OFFENDING CODE:
[Reports]![Insufficient Crew Report]![SubReport4 Basingstoke And
Deane].Report!TotalPercentOnRun.ControlSource = tempvalue

I hope that this makes sense to someone, I've run out of ideas!
Thanks in advance,
Kirsty
Nov 13 '05 #1
1 7497
You can only set a report object's RecordSource property at run-time from
within the execution of its OnOpen event. Access initializes subreports
before parent reports, so the subreport's OnOpen event has already completed
by the time the main report's OnOpen event tries to set it.

What you have to do is have the Subreport set its own Recordsource property
from its own OnOpen event handler.

On 16 Dec 2004 06:54:46 -0800, kl******@hotmail.com (Kirsty Ryder) wrote:
Hi,

I have a Report with a subreport, and I want to assign a value to the
control source of a control on the subreport depending on the value
given by the user in a separate form. Based on advice from the online
help and from other posts in this group, I wrote the following code
which is called on the On Open even of the main report. I have tried
several variations on this, which always result in the same error
message-

Run-time error 2455 'You entered an expression that has an invalid
reference to the property Form/Report.'

I have checked that the subreport name I am referring to is the
control name that appears in the main report and not the actual name
of the subreport.

THE OFFENDING CODE:
[Reports]![Insufficient Crew Report]![SubReport4 Basingstoke And
Deane].Report!TotalPercentOnRun.ControlSource = tempvalue

I hope that this makes sense to someone, I've run out of ideas!
Thanks in advance,
Kirsty


Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Aaron | last post by:
The following code works fine when previewing a Crystal report using ASP, EXCEPT when it gets to a report using a SubReport and its associated parameters. The whole report just comes up blank with...
8
by: dixie | last post by:
I have a report with a subreport. The source object for this subreport varies according to the value of a field in a table. I am trying to programmatically set the object source for the subreport...
9
by: Downstreamer | last post by:
Design is as follows: A form for the user to input criteria to be used as the where part of the report's recordsource. This includes a multiselect list box as part of the criteria selection. ...
3
by: lorirobn | last post by:
Hello, I have a report which uses a subreport. When I run the report, I get "Enter Parameter Value" error message for "tblGuestRoom". I click ok and the report seems to work fine. I...
8
by: | last post by:
hi, i have a form on which a user can choose specific criteria such as dates etc, in order to filter the report that is called from the form. i do this by using the Where section of the...
4
by: MLH | last post by:
I have a report and on it, a subreport control Main Report Name: rptInvoiceMain Sub Report Name: rptInvoiceSubReport SubReport Control Name: rptInvoiceSubReportCtl The...
17
by: =?Utf-8?B?SGVyYg==?= | last post by:
I have created a report and subreport in VB/ASP.NET. The report works fine but the subreport will not display. The subreport, when displayed as a standalone report, works fine. Any help I can...
3
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RecordSource of a Master Report is: Me.RecordSource = "TableOrQueryName"
3
by: csolomon | last post by:
Hello, I would like to copy a calculated control of an unbound control on to a report. On my form (F_SampleRequest) i have a button which opens the report. Here is the code for the button: ...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.