Hide field on report (1 Viewer)

George-Bowyer

Registered User.
Local time
Today, 11:31
Joined
Dec 21, 2012
Messages
177
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
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:31
Joined
May 7, 2009
Messages
19,243
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.
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:31
Joined
Sep 21, 2011
Messages
14,301
I would try the detail section of the report.
Me.EmailAddress.Visible = NOT Forms![NavigationForm]![NavigationSubform].Form![chkWithholdEmail]
 

George-Bowyer

Registered User.
Local time
Today, 11:31
Joined
Dec 21, 2012
Messages
177
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
 

George-Bowyer

Registered User.
Local time
Today, 11:31
Joined
Dec 21, 2012
Messages
177
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
 

June7

AWF VIP
Local time
Today, 02:31
Joined
Mar 9, 2014
Messages
5,472
Maybe use TempVars. The CF expression references TempVar. Code behind form(s) sets TempVar value.
 

plog

Banishment Pending
Local time
Today, 05:31
Joined
May 11, 2011
Messages
11,646
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.
 

George-Bowyer

Registered User.
Local time
Today, 11:31
Joined
Dec 21, 2012
Messages
177
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.
 

George-Bowyer

Registered User.
Local time
Today, 11:31
Joined
Dec 21, 2012
Messages
177
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:
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:31
Joined
Sep 21, 2011
Messages
14,301
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.
 

Users who are viewing this thread

Top Bottom