display certain information

G

Guest

I have a query that has an employees information, there are certain employees
that dont want certain information displayed, how do I do this... e.g., I
have employee xyz who does not want his home phone# displayed but would like
to display cell phone. (I dont want to delete his home phone#)
my sql statement is as follows

SELECT Table1.emplID, Table1.empLastName, Table1.empFirstName,
Table1.EmpCellNo, Table1.EmpHomeNo, *
FROM Table1;
 
D

Duane Hookom

You must store a value in a field that identifies if a field should be
displayed or not.
 
G

Guest

Ok I added a filed in my table called showNumb. Its a combox with the
following rowsource, Hse,Cell,None,both
so if an employees house and cell numbers are in the database but the
employee does want to display his house number only, then in the showNumb,
she will be selected. etc. So from here then how will I tell my query or
report not to display whats not wanted
 
D

Duane Hookom

You can set the control source of a text box on the report to something
like:
=IIf([showNumb]="Hse",[HousePhone],"")
Do similar for other text boxes. Make sure the name of the text boxes are
not the names of fields.
 
G

Guest

Thanks that worked, but what if I have None and both ie show both numbers is
ok, but if none don't display any of the numbers...

Duane Hookom said:
You can set the control source of a text box on the report to something
like:
=IIf([showNumb]="Hse",[HousePhone],"")
Do similar for other text boxes. Make sure the name of the text boxes are
not the names of fields.

--
Duane Hookom
MS Access MVP


JOM said:
Ok I added a filed in my table called showNumb. Its a combox with the
following rowsource, Hse,Cell,None,both
so if an employees house and cell numbers are in the database but the
employee does want to display his house number only, then in the showNumb,
she will be selected. etc. So from here then how will I tell my query or
report not to display whats not wanted
 
D

Duane Hookom

You should be able to figure that out from the expression I provided.

--
Duane Hookom
MS Access MVP


JOM said:
Thanks that worked, but what if I have None and both ie show both numbers
is
ok, but if none don't display any of the numbers...

Duane Hookom said:
You can set the control source of a text box on the report to something
like:
=IIf([showNumb]="Hse",[HousePhone],"")
Do similar for other text boxes. Make sure the name of the text boxes are
not the names of fields.

--
Duane Hookom
MS Access MVP


JOM said:
Ok I added a filed in my table called showNumb. Its a combox with the
following rowsource, Hse,Cell,None,both
so if an employees house and cell numbers are in the database but the
employee does want to display his house number only, then in the
showNumb,
she will be selected. etc. So from here then how will I tell my query
or
report not to display whats not wanted

:

You must store a value in a field that identifies if a field should be
displayed or not.

--
Duane Hookom
MS Access MVP


I have a query that has an employees information, there are certain
employees
that dont want certain information displayed, how do I do this...
e.g.,
I
have employee xyz who does not want his home phone# displayed but
would
like
to display cell phone. (I dont want to delete his home phone#)
my sql statement is as follows

SELECT Table1.emplID, Table1.empLastName, Table1.empFirstName,
Table1.EmpCellNo, Table1.EmpHomeNo, *
FROM Table1;
 
G

Guest

Thanks for your help.... I tried, to figure out but was not coming up with
the right answer because my report has 2 unbound text boxes one for the house
Number and the other cell number. it works ok, but when both or none iss
selected, the numbers dont show up. i tried concanating it (that is if none
or both is selected) but gave mw wrong results.

Duane Hookom said:
You should be able to figure that out from the expression I provided.

--
Duane Hookom
MS Access MVP


JOM said:
Thanks that worked, but what if I have None and both ie show both numbers
is
ok, but if none don't display any of the numbers...

Duane Hookom said:
You can set the control source of a text box on the report to something
like:
=IIf([showNumb]="Hse",[HousePhone],"")
Do similar for other text boxes. Make sure the name of the text boxes are
not the names of fields.

--
Duane Hookom
MS Access MVP


Ok I added a filed in my table called showNumb. Its a combox with the
following rowsource, Hse,Cell,None,both
so if an employees house and cell numbers are in the database but the
employee does want to display his house number only, then in the
showNumb,
she will be selected. etc. So from here then how will I tell my query
or
report not to display whats not wanted

:

You must store a value in a field that identifies if a field should be
displayed or not.

--
Duane Hookom
MS Access MVP


I have a query that has an employees information, there are certain
employees
that dont want certain information displayed, how do I do this...
e.g.,
I
have employee xyz who does not want his home phone# displayed but
would
like
to display cell phone. (I dont want to delete his home phone#)
my sql statement is as follows

SELECT Table1.emplID, Table1.empLastName, Table1.empFirstName,
Table1.EmpCellNo, Table1.EmpHomeNo, *
FROM Table1;
 
G

Guest

Actually, I did figure out how to do it....

Just incase someone else reads this post here is how I solved my problem in
addition to Duane's help....

=IIf([showNumb]="Hse",[EmpHomeNo],IIf([ShowNumb]="Both",[EmpHomeNo],IIf(IsNull([showNumb]),"?????","*****")))

Duane Hookom said:
You should be able to figure that out from the expression I provided.

--
Duane Hookom
MS Access MVP


JOM said:
Thanks that worked, but what if I have None and both ie show both numbers
is
ok, but if none don't display any of the numbers...

Duane Hookom said:
You can set the control source of a text box on the report to something
like:
=IIf([showNumb]="Hse",[HousePhone],"")
Do similar for other text boxes. Make sure the name of the text boxes are
not the names of fields.

--
Duane Hookom
MS Access MVP


Ok I added a filed in my table called showNumb. Its a combox with the
following rowsource, Hse,Cell,None,both
so if an employees house and cell numbers are in the database but the
employee does want to display his house number only, then in the
showNumb,
she will be selected. etc. So from here then how will I tell my query
or
report not to display whats not wanted

:

You must store a value in a field that identifies if a field should be
displayed or not.

--
Duane Hookom
MS Access MVP


I have a query that has an employees information, there are certain
employees
that dont want certain information displayed, how do I do this...
e.g.,
I
have employee xyz who does not want his home phone# displayed but
would
like
to display cell phone. (I dont want to delete his home phone#)
my sql statement is as follows

SELECT Table1.emplID, Table1.empLastName, Table1.empFirstName,
Table1.EmpCellNo, Table1.EmpHomeNo, *
FROM Table1;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top