How can I hide fields on a report based on the value of one field without VBA? I made an inspection of a machine and entered it into the database. Now I want to create a report with just the necessary information about the condition of the machine. So if "Visual Inspection" was answered with "good" there is no need to list the next 6 questions that ask if the inside,outside,bottom e.g. is "good". Due to company regulations I can't use VBA.
Please help. Thank you very much! Best Regards!
Kevin Yip 16 days ago
In your report's Format event, you check that if the inspection *is not* good, you make the other items visible, and vice versa. The procedure should look like:
Private Sub MyReport_Format()
Dim b As Boolean
b = (Me.Visual.Inspection <> "good")
Me.Textbox1.Visible = b
Me.Textbox2.Visible = b
Me.Textbox3.Visible = b
...
End Sub
Igor Tomasec 16 days ago
Hi Kevin, thanks for your answer. But you are using a VBA script arent you? Or can you use this in the embedded macros? Because I am not allowed to use VBA
Kevin Yip 16 days ago
You can enable VBA by going to File -> Options -> Trust Center -> Trust Center Settings -> Macro settings -> Enable VBA.
Igor Tomasec 15 days ago
Hello Kevin, The Problem is not that I can't enable it. The problem is that our company has locked VBA system wide. So If I get it running with VBA nobody else can use it.
Kevin Yip 15 days ago
You may ask whoever in charge of this in your company to write the VBA code for you. As you see in my example, the code isn't complicated. To make these kinds of design changes on the database, it's better to ask the admin to do it for you even if you have the skills and are allowed to do it, since this may involve company polices, chain of command, that kind of thing.
I'm not a big fan of macros but one of my members actually asked me a similar question to this a week or so ago so it's on my list for a video. You'd be surprised how many companies out there are locking down systems so that people can't use VBA. But yes you can do this with a macro and I'll show you how soon.
Kevin Robertson 15 days ago
Igor,
If your company doesn't allow the use of VBA you can certainly use a Macro. The screenshot below shows how. It's actually quite simple.
Richard replied as I was building and creating the image. LOL. Looking forward to the video though.