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
smurfer69Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

RomoloIT Pro, Projects, Mentor, TrainerCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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 Pro, Projects, Mentor, TrainerCommented:
Many thanks

Happy to help

R
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.