Hide field on report (1 Viewer)

George-Bowyer

Registered User.
Local time
Today, 14:43
Joined
Dec 21, 2012
Messages
178
Hello,

I have a report that generates a "Club Directory", with a page for every club showing the contact details of each officer.

They now want to be able to produce a version with no email addresses given.

Obviously I can do this by producing a second version of the report with the email fields deleted, but what I'd like to do would be to have tickbox on the Reports form that just made the email fields invisible rather then having to maintain two different versions of the same report.

My check box is at : Forms![NavigationForm]![NavigationSubform].Form![chkWithholdEmail]

What code do I need to put where in the form and sub-forms (each "office" is in a different sub-form) to make the email fields invisible?

Many thanks,

George
 
is it a Form/subform or Report/subreport?
If the report is standalone (not in navigationsubform), you can use use Conditional Format to change the color of Email field to White or just
make the Visible property to No, when the Report Opens.
 
I would try the detail section of the report.
Me.EmailAddress.Visible = NOT Forms![NavigationForm]![NavigationSubform].Form![chkWithholdEmail]
 
Thanks both.

I have gone with the conditional format turning the text white (as that was suggested first) and that has done the job.

Many thanks.

George
 
I have another problem.

I have set the conditional formatting set to print the fldemail field white on white if chkWithholdEmail on the form is set to true.

Condition is "Forms![NavigationForm]![NavigationSubform].Form![chkWithholdEmail]=True"

This works ok.

However, I now want to open a preview of an individual page of the report from another form.

How can I send the report the idea that the condition is met when the relevant form is not open?

Thanks,

George
 
Maybe use TempVars. The CF expression references TempVar. Code behind form(s) sets TempVar value.
 
I'm not entirely sure I understand the conditions, but it seems like you should flip the default.

Right now the default is to show the email field and if a form is checked you hide it. Seems like the default should be to hide that field and have the form enable it.
 
Maybe use TempVars. The CF expression references TempVar. Code behind form(s) sets TempVar value.
Yep. That worked. Thanks. Reminded me that I'd already done something similar with something else.
 
I'm not entirely sure I understand the conditions, but it seems like you should flip the default.

Right now the default is to show the email field and if a form is checked you hide it. Seems like the default should be to hide that field and have the form enable it.
Actually you're right - except when you're not. Different defaults on the different forms :unsure:
 
So pass in a flag into the report to say whether hidden or not and do not tie it to any particular form. Or use a tempvar.
 
I think this would work. It's short and simple.
Put this line in the Control Source of the Emailfield on the report.

=IIf([chkWithholdEmail], "" , [Emailfield])
and set it to grow and shrink
 

Users who are viewing this thread

Back
Top Bottom