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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filling in gaps in a Report when a field/s is empty 1

Status
Not open for further replies.

stealth3

Technical User
Sep 9, 2004
34
AU
I have a report where some fields are not always populated. I have written code so that if empty the field is not visible in the report. However the white space remains.

Is there additional code to "keep all the fields together"? The code in the (On Format) section of the Page Header is:

If IsNull(name_of_field) Then
Me.name_of_field.Visible = False
Else
Me.name_of_field.Visible = True
End If

thank you
 
A field which is not visible is still present so it still takes up space. If you want to recover the space you can set the textboxes 'can shrink' property to yes and then in code set the values to null when not required (ans visible = false if there are borders to consider).

 
If it takes up an entire section (DETAIL, or a HEADER section) you can also go into the section's OnFormat event and set CANCEL = TRUE and it won't show that section at all.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thank you both for your help. Ensuring that 'can shrink' yes was selected and also for the background worked.

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top