Change Text displayed in query result

  • Thread starter Thread starter PC
  • Start date Start date
P

PC

Hi,

I have a report which is based on an underlying query.One of the fields
[Cancelled] in the query is True/False.

My question is how would I format this on the report so only if this field
is false should "cancelled" be displayed otherwise nothing. I assume the
Text box control on the report should contain code along the lines of -
if[cancelled]=True Then Display "Cancelled" elseif[cancelled] = False then
display nothing.

Is this the correct palce to place the code and if so what is the correct
syntax.

Thanks for any advice.

...pc
 
First and foremost, rename the control in the report so that it is
UNEQUAL to any field name of the underlying datasource. (If you don't,
as I often have forgotten, you will get #Name? errors)

Now, change the controlsource for the control from [Cancelled] to
=Iif(cancelled,"Cancelled","")
Hi,

I have a report which is based on an underlying query.One of the fields
[Cancelled] in the query is True/False.

My question is how would I format this on the report so only if this field
is false should "cancelled" be displayed otherwise nothing. I assume the
Text box control on the report should contain code along the lines of -
if[cancelled]=True Then Display "Cancelled" elseif[cancelled] = False then
display nothing.

Is this the correct palce to place the code and if so what is the correct
syntax.

Thanks for any advice.

..pc
 
Yes, the control on the report is a good way to do this (though not the only
one).
Assuming your qury field is called Cancelled, you should put the following
expression in the report control's Control source property (tab Data):

=Iif([Cancelled]= True, "Cancelled","")

HTH,
Nikos
 
Yes, the control on the report is a good way to do this (though not the only

That is a useful hint, Nikos.

PC, you can change the query under the report, so the field Cancelled
contains this formula. You probably need to rename (er, relabel) that
field to prevent a reference problem.
 
Thanks Bas,

That did the trick

...pc

Bas Cost Budde said:
First and foremost, rename the control in the report so that it is
UNEQUAL to any field name of the underlying datasource. (If you don't,
as I often have forgotten, you will get #Name? errors)

Now, change the controlsource for the control from [Cancelled] to
=Iif(cancelled,"Cancelled","")
Hi,

I have a report which is based on an underlying query.One of the fields
[Cancelled] in the query is True/False.

My question is how would I format this on the report so only if this field
is false should "cancelled" be displayed otherwise nothing. I assume the
Text box control on the report should contain code along the lines of -
if[cancelled]=True Then Display "Cancelled" elseif[cancelled] = False then
display nothing.

Is this the correct palce to place the code and if so what is the correct
syntax.

Thanks for any advice.

..pc
 
Back
Top