473,378 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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.Height = 0
Me.lblSub.Height = 0
Me.GroupHeader2.Height = 300
Else
Me.srptECR.Height = 240
Me.lblSub.Height = 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 2192
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*********@AwayWithYerCrap.com> 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.Height = 0
Me.lblSub.Height = 0
Me.GroupHeader2.Height = 300
Else
Me.srptECR.Height = 240
Me.lblSub.Height = 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*********@SeeSig.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
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...
6
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...
7
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...
1
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...
1
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...
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...
1
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...
2
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...
4
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.