Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making Controls Invisible In a Report

Status
Not open for further replies.

mrweatherbee

Programmer
Jul 5, 2001
11
US
Hi guys,

I've been having some trouble with one of my reports. Basically, this report has a large number of fields, and what I want to to do is make them disappear if they are null (and have everything else move up). Many of these
fields are only one line long, so using the "Can Shrink" property won't really help...I still find myself with a large amount of white space in records that don't have all the info filled out.

I first tried to set the visibility of the fields to false if a field was blank, but that only eliminated the box and label...and didn't allow the other info to move up on the page. Right now, I had the report set the height of the records equal to 0 if the field is blank (in the detail format section), which works for the most part with one exception: checkboxes! I try and say that if the checkbox equals false then, set the height of the box = to 0, but it doesn't work, and the blank box just sits there, and the rest of the fields below can't move up, still leaving all that white space. Another problem I have is that when I have more than one records, all the fields show up as blank, whether or not they have data in it?

So I guess I'm asking 1) how do I get the checkboxes to disappear, and 2) where should I put this event procedure so that it applies to every record...the detail format just
doesn't seem to be working. Hopefully all that makes sense...Thanks a lot guys.

 
Maybe you're looking too closely at what capabilities Access provides. I don't know your data obviously but could you change the SQL statement feeding the report to filter out all records that are Len(FieldVal)=0?

Steve King Growth follows a healthy professional curiosity
 
no, we do use sql and have a query that works fine...it's just that on the report, we want it to print certain fields when they are filled, but just leave them out when they are blank and move the other fields up on the page...
 
You have to set the CanShrink property of the report section to yes in order for the fields to move up. If this is the detail section, click the properties and set CanShrink to yes. Then you'll be all set.

Joe Miller
joe.miller@flotech.net
 
yes, i've used can shrink to get rid of the field text boxes, used the height = 0 to get rid of the labels...but i'm still having trouble getting rid of the check boxes. there's no can shrink property for them, and when i try and use vba to set the height = 0, it doesn't seem to work like it does for the lables, and the empty box just remains and takes up space...that's my problem right now...
 
AHHHH, sorry!! I missed the checkboxes part! Checkboxes, comboboxes, listboxes, and lines destroy the use of CanShrink. I don't use any of them if I can help it so I can continue to use that property. So what do I do if I have checkboxes?!? I make an unbound text box that shows the Yes or No based on my checkbox field using an iif statement.

=IIf([MyCheckBoxField]=-1,"Yes","No")

Then the shrink will work. You could also use a X or a blank for yes or now as well:

=IIf([MyCheckBoxField]=-1,"X","")

Same effect, just more space conscious. Hope that helps!!! Joe Miller
joe.miller@flotech.net
 
Also,

If you don't like the way the text box looks, you can use characters from any font instead, there are some really good ones in the Wingdings font, just use the character set viewer to find a good one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top