473,756 Members | 5,955 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Report/Subreport Question

A97

I have a report/sub-report setup and for some records in the main report,
the sub-report is blank. I want to set the height of the sub-report to zero
where it is blank. I've set all the "Can shrink" properties to 'yes' but
I'm having trouble with the syntax referencing the text boxes on the sub-
report.

I get run-time error 2445 (you entered an expression that has an invalid
reference to the property form/report) on the first line of this in the
report's On open event:

If IsNull(Reports! rptECR!srptECR! txtID) Then
Me.srptECR.Heig ht = 0
Me.lblSub.Heigh t = 0
Me.GroupHeader2 .Height = 300
Else
Me.srptECR.Heig ht = 240
Me.lblSub.Heigh t = 240
Me.GroupHeader2 .Height = 540
End If

I've tried using the "Me" method to reference sub-form objects too but with
similar results.

Any suggestions greatfully received.

Keith.
Nov 13 '05 #1
2 2207
Hi Keith

You cannot use the Report_Open of the subreport like that, but you should
not need to. Further, you cannot refer to the text boxes on a subreport that
has no data: they actually don't exist.

If the subreport has no records, nothing is printed. If the subreport
control's CanShrink is set to Yes, and the main report's (Detail?) section's
CanShrink is also Yes, that should be all you need.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Keith Wilby" <ke*********@Aw ayWithYerCrap.c om> wrote in message
news:Xn******** *************** *@10.15.188.42. ..
A97

I have a report/sub-report setup and for some records in the main report,
the sub-report is blank. I want to set the height of the sub-report to
zero
where it is blank. I've set all the "Can shrink" properties to 'yes' but
I'm having trouble with the syntax referencing the text boxes on the sub-
report.

I get run-time error 2445 (you entered an expression that has an invalid
reference to the property form/report) on the first line of this in the
report's On open event:

If IsNull(Reports! rptECR!srptECR! txtID) Then
Me.srptECR.Heig ht = 0
Me.lblSub.Heigh t = 0
Me.GroupHeader2 .Height = 300
Else
Me.srptECR.Heig ht = 240
Me.lblSub.Heigh t = 240
Me.GroupHeader2 .Height = 540
End If

I've tried using the "Me" method to reference sub-form objects too but
with
similar results.

Any suggestions greatfully received.

Keith.

Nov 13 '05 #2
"Allen Browne" <Al*********@Se eSig.Invalid> wrote:
If the subreport has no records, nothing is printed. If the subreport
control's CanShrink is set to Yes, and the main report's (Detail?)
section's CanShrink is also Yes, that should be all you need.


That's worked a treat, many thanks Allen.
Nov 13 '05 #3

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

Similar topics

1
4135
by: Steve Edwards | last post by:
I am trying to use an existing report as a subreport in another report. I have the subreport added to the main report, but the only thing that shows up where the subreport should be is the name of the subreport. In reading the Access help files, it sounds like there should be LinkChildFields and LinkMasterFields proprties in the propert sheet for the subreport. However, neither of these properties are there for the subreport.. I used...
6
2700
by: David B | last post by:
I have a report with 2 sub reports on it. The report is an invoice and the sub reports are dropping data onto the invoice. This worked fine if generating 1 invoice at a time. I am trying to create a run of invoices. I would like the appropriate data for each custid from each sub report to be on the same page. The nearest I can get is 2 pages for each customer Any Thoughts TIA David B Hexham UK
7
3570
by: Ellen Manning | last post by:
I've got an A2K report showing students and their costs. Student info is in the main report and costs are in a subreport for each student. The user inputs the program desired then only those students in that program are printed. I want the subreports headings to print only for the first student on the page. Is there a way to suppress printing of the headings on subsequent students on that page? I tried the following in both the...
1
4897
by: Marie | last post by:
How do you display a total from a subreport on the main report. If it makes a difference, the total is a total of a calculated field (Qty * Price). Does the total on the subreport go in the pagefooter or report footer? Say the total is shown in a texrbox named MyTotal and the subreport control is named MySubreportControl, what exactly do I put in the control source of a textbox on the main report to show the total? Thanks For All Help! ...
1
3775
by: shaqattack1992-newsgroups | last post by:
I know this is kind of a weird question, but is there anyway to give a subreport control of a main report? I posted my situation earlier about having drawings print out after a group. I have a report grouped by part group that lists the part numbers needed from that group. I have force new page after each group. This gives me a list of parts on each page. I want to print the needed drawings after the groups/list of parts. There are...
3
7403
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...
1
8616
by: Tim Frawley | last post by:
I have created a Crystal Report with five subreports to represent datagrids on our dataentry application. The largest datagrid is the last item on the report. When empty this last subreport will print on page one of the report about halfway down the page. The problem is when this subreport has more than 50 rows it grows off the page. Not a problem as it will print all the pages necessary for this subreport but it starts the report on...
2
2425
by: Serge Fournier | last post by:
Hello everyone. How to give the connexion information to a crystal report at run time ? same question concerning the SQL string for data extraction ? Is it "a must" to disconnect the report at the end of its conception under VStudio ? Thanks for any advice.
4
3134
by: lorirobn | last post by:
Hi, I have a report displaying items that are missing from a room. I created 2 queries, the first getting the items IN the room, and the second being an "unmatched" query that references the first query where Item is Null. I use a subreport for the details, and the results display correctly. However, the Report_Details event of the subreport is executed about 2 or 3 times more than I would expect (I think 3 times when I have a
0
9456
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
10040
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
9873
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
9846
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
9713
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...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
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
6534
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();...
2
3359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.