IIF Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a Report control with the following formula:

=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0)

The control source of this report is a query. One of the fields in this
query is tblplan.eq1

When I run this report, I get an error message "Enter Parameter Value" and
the report prompts me to type the value of tblplan.eq1 When I click OK, I
get the #Name displayed for this control value.

Any idea how I can get this to work?
 
I have a Report control with the following formula:

=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0)

The control source of this report is a query. One of the fields in this
query is tblplan.eq1

When I run this report, I get an error message "Enter Parameter Value" and
the report prompts me to type the value of tblplan.eq1 When I click OK, I
get the #Name displayed for this control value.

Any idea how I can get this to work?

Is [eq1] included in the report's record source and [Flag] is Text
Datatype?

=IIf(([flag]="PLAN CYCLE"),[eq1],0)

Make sure the name of this control is not "Flag" nor "eq1".
 
If I use the expression: IIf(([flag]="PLAN CYCLE"),1,0)

it evaluates fine and I get a "1" all over. However, when I use
=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0) it gives me an error.

Flag is just a text box control in the report. tblplan.eq1 is a field
coming directly from the control source of the Report.

Any help would be appreciated. Thanks

fredg said:
I have a Report control with the following formula:

=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0)

The control source of this report is a query. One of the fields in this
query is tblplan.eq1

When I run this report, I get an error message "Enter Parameter Value" and
the report prompts me to type the value of tblplan.eq1 When I click OK, I
get the #Name displayed for this control value.

Any idea how I can get this to work?

Is [eq1] included in the report's record source and [Flag] is Text
Datatype?

=IIf(([flag]="PLAN CYCLE"),[eq1],0)

Make sure the name of this control is not "Flag" nor "eq1".
 
Why wouldn't you get rid of the "tblPlan" portion of the expression as Fredg
suggested?

--
Duane Hookom
MS Access MVP


vrk1 said:
If I use the expression: IIf(([flag]="PLAN CYCLE"),1,0)

it evaluates fine and I get a "1" all over. However, when I use
=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0) it gives me an error.

Flag is just a text box control in the report. tblplan.eq1 is a field
coming directly from the control source of the Report.

Any help would be appreciated. Thanks

fredg said:
I have a Report control with the following formula:

=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0)

The control source of this report is a query. One of the fields in
this
query is tblplan.eq1

When I run this report, I get an error message "Enter Parameter Value"
and
the report prompts me to type the value of tblplan.eq1 When I click
OK, I
get the #Name displayed for this control value.

Any idea how I can get this to work?

Is [eq1] included in the report's record source and [Flag] is Text
Datatype?

=IIf(([flag]="PLAN CYCLE"),[eq1],0)

Make sure the name of this control is not "Flag" nor "eq1".
 
I am unable to remove the tblplan.eq1 because there are 4 other eq1 fields
coming from the query (tblplan.eq1, tbllbe.eq1, tblupdate.eq1 and tblfy.eq1).
I want to show only tblplan.eq1 in this field.

I am not sure if I am explaining my problem correctly, but if you need more
clarification, please let me know.

thanks

Duane Hookom said:
Why wouldn't you get rid of the "tblPlan" portion of the expression as Fredg
suggested?

--
Duane Hookom
MS Access MVP


vrk1 said:
If I use the expression: IIf(([flag]="PLAN CYCLE"),1,0)

it evaluates fine and I get a "1" all over. However, when I use
=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0) it gives me an error.

Flag is just a text box control in the report. tblplan.eq1 is a field
coming directly from the control source of the Report.

Any help would be appreciated. Thanks

fredg said:
On Mon, 11 Jul 2005 15:04:02 -0700, vrk1 wrote:

I have a Report control with the following formula:

=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0)

The control source of this report is a query. One of the fields in
this
query is tblplan.eq1

When I run this report, I get an error message "Enter Parameter Value"
and
the report prompts me to type the value of tblplan.eq1 When I click
OK, I
get the #Name displayed for this control value.

Any idea how I can get this to work?

Is [eq1] included in the report's record source and [Flag] is Text
Datatype?

=IIf(([flag]="PLAN CYCLE"),[eq1],0)

Make sure the name of this control is not "Flag" nor "eq1".
 
I would change the field/column names in the query so that your report's
record source has unique field names. Having to use table names within a
report would be too much work and cause too much confusion.

--
Duane Hookom
MS Access MVP
--

vrk1 said:
I am unable to remove the tblplan.eq1 because there are 4 other eq1 fields
coming from the query (tblplan.eq1, tbllbe.eq1, tblupdate.eq1 and
tblfy.eq1).
I want to show only tblplan.eq1 in this field.

I am not sure if I am explaining my problem correctly, but if you need
more
clarification, please let me know.

thanks

Duane Hookom said:
Why wouldn't you get rid of the "tblPlan" portion of the expression as
Fredg
suggested?

--
Duane Hookom
MS Access MVP


vrk1 said:
If I use the expression: IIf(([flag]="PLAN CYCLE"),1,0)

it evaluates fine and I get a "1" all over. However, when I use
=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0) it gives me an error.

Flag is just a text box control in the report. tblplan.eq1 is a field
coming directly from the control source of the Report.

Any help would be appreciated. Thanks

:

On Mon, 11 Jul 2005 15:04:02 -0700, vrk1 wrote:

I have a Report control with the following formula:

=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0)

The control source of this report is a query. One of the fields in
this
query is tblplan.eq1

When I run this report, I get an error message "Enter Parameter
Value"
and
the report prompts me to type the value of tblplan.eq1 When I click
OK, I
get the #Name displayed for this control value.

Any idea how I can get this to work?

Is [eq1] included in the report's record source and [Flag] is Text
Datatype?

=IIf(([flag]="PLAN CYCLE"),[eq1],0)

Make sure the name of this control is not "Flag" nor "eq1".
 
Thank you Duane. That makes a lot of sense and I was just playing around
with using a new name and it worked.



Duane Hookom said:
I would change the field/column names in the query so that your report's
record source has unique field names. Having to use table names within a
report would be too much work and cause too much confusion.

--
Duane Hookom
MS Access MVP
--

vrk1 said:
I am unable to remove the tblplan.eq1 because there are 4 other eq1 fields
coming from the query (tblplan.eq1, tbllbe.eq1, tblupdate.eq1 and
tblfy.eq1).
I want to show only tblplan.eq1 in this field.

I am not sure if I am explaining my problem correctly, but if you need
more
clarification, please let me know.

thanks

Duane Hookom said:
Why wouldn't you get rid of the "tblPlan" portion of the expression as
Fredg
suggested?

--
Duane Hookom
MS Access MVP


If I use the expression: IIf(([flag]="PLAN CYCLE"),1,0)

it evaluates fine and I get a "1" all over. However, when I use
=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0) it gives me an error.

Flag is just a text box control in the report. tblplan.eq1 is a field
coming directly from the control source of the Report.

Any help would be appreciated. Thanks

:

On Mon, 11 Jul 2005 15:04:02 -0700, vrk1 wrote:

I have a Report control with the following formula:

=IIf(([flag]="PLAN CYCLE"),tblplan.eq1,0)

The control source of this report is a query. One of the fields in
this
query is tblplan.eq1

When I run this report, I get an error message "Enter Parameter
Value"
and
the report prompts me to type the value of tblplan.eq1 When I click
OK, I
get the #Name displayed for this control value.

Any idea how I can get this to work?

Is [eq1] included in the report's record source and [Flag] is Text
Datatype?

=IIf(([flag]="PLAN CYCLE"),[eq1],0)

Make sure the name of this control is not "Flag" nor "eq1".
 
Back
Top