header text

  • Thread starter Thread starter Basil
  • Start date Start date
B

Basil

Hiya,

I have a header on a field called "Status". Lets say
[Status] can equal "Returned","Active" or "On Hold".

I want the status field in the report to show the status
followed by something as follows:

[Status] & IIF([Status]="Returned"," in last week"," now")

For some reason this doesn't work

(Returns: "Syntax error in query expression 'First
([[Status] & IIF([Status]="Returned"," in last week","
now")])'.)

But if I have another field (rather than text) at the end
of the statement it does work:

[Status] & IIF([Status]="Returned"," in last week"," now")
& [Status]

Why??? And more importantly how can I get round this?

Thanks loads!

Basil
PS Access 97.
 
Did you have an equal sign as the first character:
=[Status] & IIF([Status]="Returned"," in last week"," now")
Make sure the name of control is not "Status".
 
Basil said:
I have a header on a field called "Status". Lets say
[Status] can equal "Returned","Active" or "On Hold".

I want the status field in the report to show the status
followed by something as follows:

[Status] & IIF([Status]="Returned"," in last week"," now")

For some reason this doesn't work

(Returns: "Syntax error in query expression 'First
([[Status] & IIF([Status]="Returned"," in last week","
now")])'.)

But if I have another field (rather than text) at the end
of the statement it does work:

[Status] & IIF([Status]="Returned"," in last week"," now")
& [Status]


Not much to go on here, but you did not have the = sign at
the front of the expression. Another thing to watch out for
is that the text box with this expression can not be named
"Status"
 
sorry... I still don't get when to put an = and when not
to. Thanks for your time, sorry if I wasted it (but it
did save me masses of it!)
-----Original Message-----
Did you have an equal sign as the first character:
=[Status] & IIF([Status]="Returned"," in last week"," now")
Make sure the name of control is not "Status".

--
Duane Hookom
Microsoft Access MVP


Hiya,

I have a header on a field called "Status". Lets say
[Status] can equal "Returned","Active" or "On Hold".

I want the status field in the report to show the status
followed by something as follows:

[Status] & IIF([Status]="Returned"," in last week"," now")

For some reason this doesn't work

(Returns: "Syntax error in query expression 'First
([[Status] & IIF([Status]="Returned"," in last week","
now")])'.)

But if I have another field (rather than text) at the end
of the statement it does work:

[Status] & IIF([Status]="Returned"," in last week"," now")
& [Status]

Why??? And more importantly how can I get round this?

Thanks loads!

Basil
PS Access 97.


.
 
The equal sign is optional only when the control source is a single field
from the report's record source. In all other expressions, the equal sign
must be present. Also, the control name must not be the name of a field if
an equal sign is used.

--
Duane Hookom
Microsoft Access MVP


Basil said:
sorry... I still don't get when to put an = and when not
to. Thanks for your time, sorry if I wasted it (but it
did save me masses of it!)
-----Original Message-----
Did you have an equal sign as the first character:
=[Status] & IIF([Status]="Returned"," in last week"," now")
Make sure the name of control is not "Status".

--
Duane Hookom
Microsoft Access MVP


Hiya,

I have a header on a field called "Status". Lets say
[Status] can equal "Returned","Active" or "On Hold".

I want the status field in the report to show the status
followed by something as follows:

[Status] & IIF([Status]="Returned"," in last week"," now")

For some reason this doesn't work

(Returns: "Syntax error in query expression 'First
([[Status] & IIF([Status]="Returned"," in last week","
now")])'.)

But if I have another field (rather than text) at the end
of the statement it does work:

[Status] & IIF([Status]="Returned"," in last week"," now")
& [Status]

Why??? And more importantly how can I get round this?

Thanks loads!

Basil
PS Access 97.


.
 
Back
Top