Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding a field for certain records in a Report 4

Status
Not open for further replies.

tattie

IS-IT--Management
Jun 29, 2003
11
US
Hi,
I need help in figuring out how to hide one field in a report for only specific records, not all records. The report is a school's Parent Directory, where some parents don't want their email addresses on it, but everyone else does. The email address is used for those parents on other in-house reports, where it needs to appear. But for the Parent Directory report, I need to hide it. I'm already limiting the records that are displayed in the query for this report since some parents don't want to be in the directory at all. That part is working fine.
Any suggestions, please?

Thanks!!!
 
Try this assuming you have a yes/no check box or indicator as to whether or not the parents want their info released.
Code:
IF RevealPhone = [COLOR=blue]True[/color] THEN
   Me!ParentPhone.Visible = [COLOR=blue]True[/color]
ELSE Me!ParentPhone.Visible = [COLOR=blue]False[/color]
END IF

Let me know if this helps or if you have any questions...

Xavier

----------------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning."
Rick Cook
----------------------------------------
 
Hi,
No, I don't have a yes/no checkbox for that. Is there a different way of restricting a field from appearing? Can it be done in a query?

Thanks,
Robyn
 
How do you specify whether or not the parent wants their information to show up?...

Xavier

----------------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning."
Rick Cook
----------------------------------------
 
I'm not a programmer, and have never done any coding in Access. For parents who don't want to appear AT ALL in the Parent Directory, I tell my query to not include their records. Is coding the only way to accomplish this? I'd like to keep the database as simple as possible.

Thank you for your time!

Tattie
 
I should add that this is a very small database for a very small private school with no more than 100 students/records. It's in Access 2000. Hope this info helps.
 
In your query what criteria do you use to filter out the parents that don't want their e-mail addresses to show.

The coding for this would be very simple, and we could walk you through this without any trouble.

 
The basic question -

Ignore the query right now - how do you know (in the database or not) which parents dont want there data shown?

----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
 
You should be able to do this in a query but the question we are all waiting to be answered is how do you note, within the database, which parent doesn't want their phone number to appear?

Xavier

----------------------------------------
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning."
Rick Cook
----------------------------------------
 
Hello everyone,
The answer you've been waiting for (sorry) is that I currently do not note in the database which parents don't want their email address listed in the "Parent Directory" report. I simply have the paperwork the parents filled out when they provided their email address, specifying that it's OK to use their email address on in-house reports, but not on the "Parent Directory" report.

I have not been able to create a query that limits the email addresses from appearing for the few parents who don't want it listed. They want their names, addresses & home phone numbers to appear, but not their email addresses. Most of the parents are OK with sharing email addresses, there are only 4 who don't.

Thank you for any and all help you guys can provide!

Tattie
 
Tattie,

Your best bet would be to first add a (Yes/No) ie. Checkbox field to your table. Then for each parent that doesn't want there e-mail address to be visible, check the box.

Once you have done that you can filter out those people by making the criteria of that checkbox in your query =False

This would eliminate all parents that you have put a check in their box.

If you want their names to appear but just not their e-mail addresses this would have to be done with some simple coding.

Aaron



 
Hi,
Thanks for your reply. I know how to restrict records in a query, but what I'd like to know is if there's a way for a query to limit one field (the email address) from a specific record in the table from appearing? Or any other method in Access other than coding? Besides the fact that I know "Jack" about coding, I need to keep the db as simple as possible because once I'm done with the db, a Word Processor will be responsible for maintaining all aspects of the db in the future, and I don't think she will be willing to deal with that.

I would like to know from you guys out there if the ONLY WAY Access is capable of restricting one field of a record from appearing in a report is through code?

Thank you so much for your replies!
-tattie
 
Yes,

If you are looking for that field to only not be visible for certain records the only way you will be able to do it is with code.

My best suggestion for you if you want to do it without coding would be add another field to your table and enter the e-mail address a second time, but for only those people who don't want their e-mail addresses shown.

That way you can delete their e-mail addresses from the first e-mail field, and use the first e-mail field in your report. So you can store everyone's e-mail address. Just one field for those who want them displayed and one for those who don't.

Hope this helps.
 
I would stick by Aaron`s first sugguestion - much more logical.

----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
 
Hi,
Your suggestion will work. Thank you for the idea! I should have thought of that, but I was hoping for a query/subquery way of doing it.

Thank you!

-tattie
 
It shouldnt take a few mins to do if there is only a few which dont want there email address shown.

All you have to do is add a new field - a boolean, default is yes (show email address) then for the few that arent put no.

Then in your query you can do an IIF([boolean field]='yes',[email address],'')

Dan

----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
 
Thanks Plank,
I will give it a try.

-tattie
 
How are ya tattie . . . . .

See my post at the bottom in thread703-895047

Calvin.gif
See Ya! . . . . . .
 
Plank, I cannot speak for Tattie, but your suggestion worked out great for my question thread703-895047.

Thanks again,
Wantabie

Here is your star...
 
Hey Plank,
I need some additional guidance from you on your suggestion of entering IIF([boolean field]='yes',[emailaddress],"") into my query. I tried adding it to my current query in Design View, in the criteria field for the boolean field, but that doesn't work. I get a "data type mismatch" error. How should I be adding this to my query?

Thank you,
tattie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top