Hide blank fields in a report?

O

OBrien16

I have a report that involves a lot of groups, each includes up to 4 names.
If a group only consists of 1, 2 or 3 names, I would like to block the other
3, 2, or 1 (respectively) blank field(s) from being visible. The effect of
this would be to shorten each group to show only what is actually there, and
save a lot of page space.
 
L

Larry Linson

I think we are going to have to understand more for anyone to be able to be
of help. What is the relationship between the "1, 2, or 3 names" and the
groups? Are the "names" detail records within the group, or are they fields
within a table, or ???. Please clarify and someone may be able to make
useful suggestions.

Larry Linson
Microsoft Access MVP
 
S

Steve Schapel

OBrien,

The Can Shrink property of the 'names' textbox may be applicable here.
Set this property to Yes, and also the Can Shrink property of the
relevant report section itself. Then, as long as there are no other
non-shrinking controls on the same "horizontal" level as the names
textboxes, the controls will collapse if they are blank.
 
S

sbcaco

I changed the can shrink property in all of the controls of a report and put
this in the detail format:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.TransType.Visible = (Me.[TransType] <> "ADJ")
Me.Date.Visible = (Me.[TransType] <> "ADJ")
Me.Amount.Visible = (Me.[TransType] <> "ADJ")
End Sub

The problem is there are blank lines where these records would be. How do I
remove those lines?
thanks!
 
K

kc

I found this post because I was having a similar problem. This helped reduce
the number of blank rows, but I had to also sort the records in the query so
that only one blank row "showed" up at the end of the list.
 
M

Marshall Barton

kc said:
I found this post because I was having a similar problem. This helped reduce
the number of blank rows, but I had to also sort the records in the query so
that only one blank row "showed" up at the end of the list.

sbcaco said:
I changed the can shrink property in all of the controls of a report and put
this in the detail format:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.TransType.Visible = (Me.[TransType] <> "ADJ")
Me.Date.Visible = (Me.[TransType] <> "ADJ")
Me.Amount.Visible = (Me.[TransType] <> "ADJ")
End Sub

The problem is there are blank lines where these records would be. How do I
remove those lines?


Have you set those text box's and their section'sCanShrink
property to Yes?

If you did, then there is probably some other control in the
same "horizontal band" that is prevents the space from being
reclaimed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top