IFF

  • Thread starter Thread starter Jens R. Rasmussen
  • Start date Start date
J

Jens R. Rasmussen

I have a report which lists the records from a table containing the field
HVILKET and the field BETALT.
Now I want only to show BETALT if HVILKET = "kommer".

Therefore I have tried in the the control source to write

IFF([HVILKET]="kommer";[BETALT];"-")

It works fine for HVILKET <> "kommer", but when HVILKET = "Kommer" I get an
error (#error) in stead of the expected value for BETALT

So my syntax must be in error. please help.

regards
/jens
 
Jens

Have you tried searching for IIF() in Access HELP? I believe the correct
syntax is shown there.

Regards

Jeff Boyce
Microsoft Access MPV

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
Jens said:
I have a report which lists the records from a table containing the field
HVILKET and the field BETALT.
Now I want only to show BETALT if HVILKET = "kommer".

Therefore I have tried in the the control source to write

IFF([HVILKET]="kommer";[BETALT];"-")

It works fine for HVILKET <> "kommer", but when HVILKET = "Kommer" I get an
error (#error) in stead of the expected value for BETALT


Just in case tho misspelled IIf is a typo, check to make
sure that the text box is NOT named BETALT
 
The control source is missing "=" at the beginning. Also, the function is
IIf() not IFF().

Is BETALT a field in your report's Record Source?
 
"Duane Hookom" skrev:
The control source is missing "=" at the beginning. Also, the function is
IIf() not IFF().

yes, sorry for writing too quickly. However I have wrote
=IIF([HVILKET]="kommer";[BETALT];"-")

and when HVILKET said:
Is BETALT a field in your report's Record Source?

Yes containing figures like 250,00
--
Duane Hookom
Microsoft Access MVP
regards
/Jens
Jens R. Rasmussen said:
I have a report which lists the records from a table containing the field
HVILKET and the field BETALT.
Now I want only to show BETALT if HVILKET = "kommer".

Therefore I have tried in the the control source to write

IFF([HVILKET]="kommer";[BETALT];"-")

It works fine for HVILKET <> "kommer", but when HVILKET = "Kommer" I get an
error (#error) in stead of the expected value for BETALT

So my syntax must be in error. please help.

regards
/jens
 
"Marshall Barton" skrev:
Jens said:
I have a report which lists the records from a table containing the field
HVILKET and the field BETALT.
Now I want only to show BETALT if HVILKET = "kommer".

Therefore I have tried in the the control source to write

IFF([HVILKET]="kommer";[BETALT];"-")

It works fine for HVILKET <> "kommer", but when HVILKET = "Kommer" I get an
error (#error) in stead of the expected value for BETALT

check to make sure that the text box is NOT named BETALT

that was the mistake. Now I rename the box to BETALING and in the control
elements I use the FIELD BETALT.

thank you for your help.
regards
/Jens
Marsh
MVP [MS Access]
.
 
Back
Top