• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 544
  • Last Modified:

hide associated text box when field is null in report

I have a report in access 2007, which lists catagories, some of the catagories have sub-catagories,  attached to the catagories are text boxes which are there simply to have a place to fill in on paper date acheived etc.  The items which have sub-catagories alos need these boxes but only when they are present, if I add the text boxes they show even when the sub is null and it makes the formatting a mess.  I need a way to somehow hide the text boxes when the value is null
0
smurfer69
Asked:
smurfer69
  • 2
  • 2
  • 2
1 Solution
 
clarkscottCommented:
In design view, right-click on the left margin report section where the field resides (Header, Detail, etc.) and select the FORMAT propert.
In this code section.....

If isnull(me.YouField) then
    me.YourTextBox.visible = false
else
   me.YourTextBox.visbible = true
end if

Scott C
0
 
smurfer69Author Commented:
The code does not seem to run, I had initial forgotten the end if and no error
0
 
smurfer69Author Commented:
I have a question what stops the detail section from showing when ther is not data in the sub?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
RomoloIT Professional ConsultantCommented:
Select the field in the reprot./. Right click Properties

Goto Can Shrink property

When the field is empty it will hide the field

R
0
 
clarkscottCommented:
Did you right-click on the Report Section - on the gray box in the left side margin- Detail, Header, Footer, etc?
Did you select Properties from the exposed menu?

Did you select ON FORMAT event and enter the code?

You can alway type STOP in the code (before any other code).  The app will break at that point and display the code (stop on the word "STOP")

If the app doesn't stop - then you've coded something that isn't part of 'the process'.

Scott C

0
 
RomoloIT Professional ConsultantCommented:
Many thanks

Happy to help

R
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now