G
Guest
I don't understand this. As far as I can see, these should be working. I like
to make test databases every so often to test out some new things I will have
to do for an actual database my company needs, this way if I mess up, I mess
up with a test database and not the real one.
In my test database, I am trying to create a report and use several IIf
clauses. The test database is a list of people I know. Several of my IIf
clauses work, several don't.
The report is only reading from one table and the whole table is in the
record source for the report. Why are these not working?! Any help would be
greatly appreciated. I just cannot understand this.
Here is one that does work:
=IIf([Lname],[Lname],Null) & ", " & IIf([Fname],[Fname],Null) & " "
This one prints the persons last name if they had a last name entered, then
a comma, then their first name of they had one entered, then a space. If
either a first name or last name doesn't exist, it is left blank (Null).
Here are the ones that do not:
=IIf([YrsKnown] > 5,"Wow!",[YrsKnown])
This one should display "Wow!" if the person knew me more than 5 years, and
simply display the number of years they have known me if it is less. Also,
just to try it out, I also used =5 instead of >5 and that didn't work either.
All I get either way is #Error
=IIf([RelToPaul]="Cat","=^..^=",[RelToPaul])
In this one, if their relationship to me is cat, it should display that
little kitty emoticon, otherwise it should just display whatever was entered
as their relationship to me. That also only produces #Error.
--
Have a nice day!
~Paul
Express Scripts,
Charting the future of pharmacy
to make test databases every so often to test out some new things I will have
to do for an actual database my company needs, this way if I mess up, I mess
up with a test database and not the real one.
In my test database, I am trying to create a report and use several IIf
clauses. The test database is a list of people I know. Several of my IIf
clauses work, several don't.
The report is only reading from one table and the whole table is in the
record source for the report. Why are these not working?! Any help would be
greatly appreciated. I just cannot understand this.
Here is one that does work:
=IIf([Lname],[Lname],Null) & ", " & IIf([Fname],[Fname],Null) & " "
This one prints the persons last name if they had a last name entered, then
a comma, then their first name of they had one entered, then a space. If
either a first name or last name doesn't exist, it is left blank (Null).
Here are the ones that do not:
=IIf([YrsKnown] > 5,"Wow!",[YrsKnown])
This one should display "Wow!" if the person knew me more than 5 years, and
simply display the number of years they have known me if it is less. Also,
just to try it out, I also used =5 instead of >5 and that didn't work either.
All I get either way is #Error
=IIf([RelToPaul]="Cat","=^..^=",[RelToPaul])
In this one, if their relationship to me is cat, it should display that
little kitty emoticon, otherwise it should just display whatever was entered
as their relationship to me. That also only produces #Error.
--
Have a nice day!
~Paul
Express Scripts,
Charting the future of pharmacy