473,703 Members | 2,766 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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!TotalPe rcentOnRun.Cont rolSource = tempvalue

I hope that this makes sense to someone, I've run out of ideas!
Thanks in advance,
Kirsty
Nov 13 '05 #1
1 7663
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******@hotmai l.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!TotalPe rcentOnRun.Cont rolSource = 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
5438
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 this error message: "The Error Message was: Error detected by database DLL.from: Crystal Reports ActiveX Designer". What am I doing wrong in the SubReport section below and how do I properly pass in sproc params to the subreport? Thanks. ...
8
13269
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 as part of the detail format section of the report. I have been playing around with things like: Me.SubReport.SourceObject = Report.sub5O5L but nothing seems to work. Can I achieve what I want to do and if so, can anyone give me the...
9
2826
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. The report is generated from a button on this form. In the button's onclick event a where clause is built and assigned to a public variable. Because of the multiselect listbox I use IN as part of the where clause, for example, sqlstr = " ...
3
7391
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 narrowed down this error to the Link Master Fields property setting, when I tried the same scenario with form/subform. It gave me error: 'The Link Master fields property setting has produced this error: The object doesn't contain the Automation object...
8
13523
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 docmd.openreport as follows DoCmd.OpenReport stDocName, acPreview, , strWhere where strWhere is a string dependant on the choices the user makes in the
4
3281
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 subreport contains 2 fields - a text field where line items sold are listed and a currency field where the price per item is shown. The subreport control displays these two fields when the main report is opened.
17
20333
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 find on this error refers to the WinForms.ReportViewer and none to the WebForms.ReportViewer. Anyone have any guidance?
3
9399
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
2578
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: Private Sub btnOpenSampleReport_Click() DoCmd.OpenReport "R_SampleRequest" 'Open Report SampleRequest
0
8743
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8659
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9239
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6585
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5920
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.