Skipping NULL fields in a report... (1 Viewer)

RIM-Pro

Registered User.
Local time
Today, 04:58
Joined
Aug 11, 2000
Messages
22
I have a report that includes main headings, and may include 10 sub-headings that will be listed underneath each one.

I want to be able to print this report and include only those sub-headings that are populated, leaving out the blank spaces for those sub-headings that are not populated.

I know that in designing my report, I have to accomodate the possibility that all 10 sub-headings may need to appear under a main heading. Therefore, I have the fields for all 10 sub-headings on the report... but is there a way to tell Access that, for example, if sub-headings 7-10 are null, then don't leave spaces for them? If I can do this, then in this example my next main heading would start just underneath sub-heading 6.

Thanks in advance for your help.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 23:58
Joined
Feb 19, 2002
Messages
43,457
Set the CanShrink and CanGrow properties of each of the heading sections and each control contained in them to yes.
 

RIM-Pro

Registered User.
Local time
Today, 04:58
Joined
Aug 11, 2000
Messages
22
Thanks for your response Pat, but I should've explained that my sub-headings are all Combo Box lookup fields that do not have "CanGrow" or "CanShrink" properties. What I want to do just may not be possible, but thanks for your help. I am still open to any other ideas...
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 23:58
Joined
Feb 19, 2002
Messages
43,457
What is the point of using combo boxes in a report? Change the control types to text boxes.
 

p00le

New member
Local time
Today, 04:58
Joined
May 1, 2001
Messages
8
I am having the same problem. I have set the can shrink property to yes for the detail section of my report, however a large blank area appears when I preview. Any suggestions?

Thanks In advance.
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 23:58
Joined
Feb 19, 2002
Messages
43,457
You also need to set the CanShrink and CanGrow properties to yes for the section that contains the fields you are hiding. Also, make sure that none of the controls overlap. Access will not shrink them if they overlap.
 

lscheer

Registered User.
Local time
Today, 04:58
Joined
Jan 20, 2000
Messages
185
Also make sure that your field labels are not in the detail of the report (if you are including labels)...they should be in the appropriate section headers.
 

p00le

New member
Local time
Today, 04:58
Joined
May 1, 2001
Messages
8
Thanks to Pat's advice, my problem is half solved. The detail section of my report is set up in a three column 'table' where the borders of the text boxes joined to form the table's grid lines and by separating the text box borders they now shrink when null. However, if the record is not null in column 1 then columns 2 and 3 should not shrink. Does anyone know of a command I could put in an If Then statement that will prevent the boxes in columns 2 and 3 from shrinking when column 1 is not null? Access produces an error when I try:

If Not IsNull [column1] Then
Me![column2].CanShrink = False
Me![column3].CanShrink = False

So I tried setting the height, width, and borderstyle, but have not achieved the desired results. Your input is greatly appreciated, Julia
 

Users who are viewing this thread

Top Bottom