Re: =Iff(([Me]![Gender])="M","Male","Female")



On 30 Dec 2005 11:23:17 -0800, campbellbrian2001@xxxxxxxxx wrote:

> Thanks in Advance! ... I have two textboxes: 1 is visible (and gets its
> value based on the invisible textbox and displays either "Male" or
> "Female", and needs to display either male of female based on the value
> that comes up in the tables record as "M" or "F".
> I tried:
>
> =Iff(([Me]![Gender])="M","Male","Female")
>
> 'the [Me] is form, [Gender] is the textbox name
>
> and this does not work.
>
> Is my syntax wrong or can I just have one box and its displayed value
> display "Female" if the record says "F"?
>
> Thanks! Brian

1) You cannot use the Me keyword in an Access control source.
And as has already been pointed out by others, the function is IIF not
IFF.
Try:
=IIf(([Gender]="M","Male","Female")
Make sure the name of this control is not "Gender".

2) Why a field that stores "M" or "F"? Why not just simply store
"Male" or "Female"? Or since there are only the 2 choices, why not a
Check Box field? Then in a regular unbound text control on your
report, set the control source to the CheckBox field and have it's
Format property set to:
;"Male";"Female"
assuming Male is the checked value.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.



Relevant Pages

  • Re: Flightless Bird Evolution
    ... part of the male to entice the female? ... There are a few species in which the female displays to ... Do bird mating displays take the ... display or behavior intended to cause another male to give way. ...
    (talk.origins)
  • Re: Calculating values from an option group
    ... Try a text box with a control source like: ... This assumes your option group value is a 1 for either male or female. ...
    (microsoft.public.access.reports)
  • Re: Hummer Wars!
    ... female doesn't leave, the male may take it as a sign of readiness to ... display with lots of buzzy noise, ...
    (rec.birds)
  • =Iff(([Me]![Gender])="M","Male","Female")
    ... "Female", and needs to display either male of female based on the value ... Is my syntax wrong or can I just have one box and its displayed value ...
    (comp.databases.ms-access)
  • Combo box Problem ???
    ... How to make the combo box display text or initial value without select from the arrow. ... cboGender consists of two item - male and female, I want to display male as default text on the control ...
    (microsoft.public.dotnet.framework.compactframework)