Displaying Value if Field value is a certain value

D

Drew

I am working on a report using Access. I would like to display DD/ if the
EmpDD field is 1 (it is a bit field, 1 or 0). How can I accomplish this? I
am using Access XP (2002)

Thanks,
Drew
 
G

Guest

Try this...
Assuming you mean a "DD/" prefix to the value, instead
of using the [EmpDD] field in the report, use a text box
containing: ="DD/"&[EmpDD].
If you want to display ONLY when EmpDD=1 and display
nothing when [EmpDD]=0, then in the text box say: =iif
([EmpDD=1,"DD/"&[EmpDD],"").
If you want to display in both cases but only prefix
the 1 case, then in the text box say: =iif([EmpDD]=1,"DD/"&
[EmpDD],[EmpDD]).

HTH
 
B

Brendan Reynolds

Something like the following in the Control Source of a text box should do
it ...

=IIf([EmpDD] = 1, "DD/", "")

Check out "IIf() Function" in the help file for details.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
D

Drew

Still didn't work... I am develping a ADP, is that any different?

Thanks,
Drew

Try this...
Assuming you mean a "DD/" prefix to the value, instead
of using the [EmpDD] field in the report, use a text box
containing: ="DD/"&[EmpDD].
If you want to display ONLY when EmpDD=1 and display
nothing when [EmpDD]=0, then in the text box say: =iif
([EmpDD=1,"DD/"&[EmpDD],"").
If you want to display in both cases but only prefix
the 1 case, then in the text box say: =iif([EmpDD]=1,"DD/"&
[EmpDD],[EmpDD]).

HTH

-----Original Message-----
I am working on a report using Access. I would like to display DD/ if the
EmpDD field is 1 (it is a bit field, 1 or 0). How can I accomplish this? I
am using Access XP (2002)

Thanks,
Drew


.
 
G

Guest

Hi Drew,
Hmmm... I'm an A97 user, so maybe I'm missing something
re A2000.
I don't understand "ADP" - ? Maybe it's a "duh", but
spell it out, please.
Also, when you say [EmpDD] is a bit field, is that
unique to A2000, or do you mean it's a byte field that's
user-set to either 1 or 0 within an allowable range of 0-
256, or do you mean it's a Yes/No field? If the latter,
then True=-1, not 1, so maybe you need to test for [EmpDD]
=-1 for true cases.

Nothing beats a face-to-face with the beast on screen, but
let's keep going until the nut is cracked.

HJ

-----Original Message-----
Still didn't work... I am develping a ADP, is that any different?

Thanks,
Drew

Try this...
Assuming you mean a "DD/" prefix to the value, instead
of using the [EmpDD] field in the report, use a text box
containing: ="DD/"&[EmpDD].
If you want to display ONLY when EmpDD=1 and display
nothing when [EmpDD]=0, then in the text box say: =iif
([EmpDD=1,"DD/"&[EmpDD],"").
If you want to display in both cases but only prefix
the 1 case, then in the text box say: =iif([EmpDD] =1,"DD/"&
[EmpDD],[EmpDD]).

HTH

-----Original Message-----
I am working on a report using Access. I would like to display DD/ if the
EmpDD field is 1 (it is a bit field, 1 or 0). How can
I
accomplish this? I
am using Access XP (2002)

Thanks,
Drew


.


.
 
D

Drew

I got it working... here is the code,

=IIf([EmpDirectDeposit]=True,"DD/","")

(incidently, I changed the EmpDD to EmpDirectDeposit)

Thanks,
Drew

Hi Drew,
Hmmm... I'm an A97 user, so maybe I'm missing something
re A2000.
I don't understand "ADP" - ? Maybe it's a "duh", but
spell it out, please.
Also, when you say [EmpDD] is a bit field, is that
unique to A2000, or do you mean it's a byte field that's
user-set to either 1 or 0 within an allowable range of 0-
256, or do you mean it's a Yes/No field? If the latter,
then True=-1, not 1, so maybe you need to test for [EmpDD]
=-1 for true cases.

Nothing beats a face-to-face with the beast on screen, but
let's keep going until the nut is cracked.

HJ

-----Original Message-----
Still didn't work... I am develping a ADP, is that any different?

Thanks,
Drew

Try this...
Assuming you mean a "DD/" prefix to the value, instead
of using the [EmpDD] field in the report, use a text box
containing: ="DD/"&[EmpDD].
If you want to display ONLY when EmpDD=1 and display
nothing when [EmpDD]=0, then in the text box say: =iif
([EmpDD=1,"DD/"&[EmpDD],"").
If you want to display in both cases but only prefix
the 1 case, then in the text box say: =iif([EmpDD] =1,"DD/"&
[EmpDD],[EmpDD]).

HTH


-----Original Message-----
I am working on a report using Access. I would like to
display DD/ if the
EmpDD field is 1 (it is a bit field, 1 or 0). How can I
accomplish this? I
am using Access XP (2002)

Thanks,
Drew


.


.
 
D

Drew

Also, ADP is the new Access Data Project, which is essentially a front end
to SQL Server. After getting a quote for Crystal Enterprise which was a 5
digit quote, I decided to use Access to do the reporting.

Thanks,
Drew

Hi Drew,
Hmmm... I'm an A97 user, so maybe I'm missing something
re A2000.
I don't understand "ADP" - ? Maybe it's a "duh", but
spell it out, please.
Also, when you say [EmpDD] is a bit field, is that
unique to A2000, or do you mean it's a byte field that's
user-set to either 1 or 0 within an allowable range of 0-
256, or do you mean it's a Yes/No field? If the latter,
then True=-1, not 1, so maybe you need to test for [EmpDD]
=-1 for true cases.

Nothing beats a face-to-face with the beast on screen, but
let's keep going until the nut is cracked.

HJ

-----Original Message-----
Still didn't work... I am develping a ADP, is that any different?

Thanks,
Drew

Try this...
Assuming you mean a "DD/" prefix to the value, instead
of using the [EmpDD] field in the report, use a text box
containing: ="DD/"&[EmpDD].
If you want to display ONLY when EmpDD=1 and display
nothing when [EmpDD]=0, then in the text box say: =iif
([EmpDD=1,"DD/"&[EmpDD],"").
If you want to display in both cases but only prefix
the 1 case, then in the text box say: =iif([EmpDD] =1,"DD/"&
[EmpDD],[EmpDD]).

HTH


-----Original Message-----
I am working on a report using Access. I would like to
display DD/ if the
EmpDD field is 1 (it is a bit field, 1 or 0). How can I
accomplish this? I
am using Access XP (2002)

Thanks,
Drew


.


.
 
G

Guest

Good enough! You might even try:
=iif(EmpDirectDeposit],...) without saying =True;
logically it should evalute True/False on its own if it's
a Yes/No variable.

Regards. HJ
-----Original Message-----
I got it working... here is the code,

=IIf([EmpDirectDeposit]=True,"DD/","")

(incidently, I changed the EmpDD to EmpDirectDeposit)

Thanks,
Drew

Hi Drew,
Hmmm... I'm an A97 user, so maybe I'm missing something
re A2000.
I don't understand "ADP" - ? Maybe it's a "duh", but
spell it out, please.
Also, when you say [EmpDD] is a bit field, is that
unique to A2000, or do you mean it's a byte field that's
user-set to either 1 or 0 within an allowable range of 0-
256, or do you mean it's a Yes/No field? If the latter,
then True=-1, not 1, so maybe you need to test for [EmpDD]
=-1 for true cases.

Nothing beats a face-to-face with the beast on screen, but
let's keep going until the nut is cracked.

HJ

-----Original Message-----
Still didn't work... I am develping a ADP, is that any different?

Thanks,
Drew

Try this...
Assuming you mean a "DD/" prefix to the value, instead
of using the [EmpDD] field in the report, use a text box
containing: ="DD/"&[EmpDD].
If you want to display ONLY when EmpDD=1 and display
nothing when [EmpDD]=0, then in the text box say: =iif
([EmpDD=1,"DD/"&[EmpDD],"").
If you want to display in both cases but only prefix
the 1 case, then in the text box say: =iif([EmpDD] =1,"DD/"&
[EmpDD],[EmpDD]).

HTH


-----Original Message-----
I am working on a report using Access. I would like to
display DD/ if the
EmpDD field is 1 (it is a bit field, 1 or 0). How
can
I
accomplish this? I
am using Access XP (2002)

Thanks,
Drew


.



.


.
 

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