switch function

G

gina

I have a form retrieving data from db2, and I want to convert code values to
description. I tried to use Control Source and

switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is from data field... I tried different combinations of this
statement... never made it work... I am wondering whether it should be done
somewhere other than control source, or the reference to the field is
incorrect... please help.
 
B

BruceM

As the Control Source for a text box you would need an = sign in front of
the expression. However, maybe there is a problem elsewhere. What do you
mean when you say that [CHN_CD] is a data field? The data type is defined
in table design view. Is it text, number, or what exactly?
 
G

gina

= sign is automatically put ... so that was not the issue.
i.e.
=switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is the field name in the db2 table which form is reading from...


BruceM said:
As the Control Source for a text box you would need an = sign in front of
the expression. However, maybe there is a problem elsewhere. What do you
mean when you say that [CHN_CD] is a data field? The data type is defined
in table design view. Is it text, number, or what exactly?

gina said:
I have a form retrieving data from db2, and I want to convert code values
to
description. I tried to use Control Source and

switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is from data field... I tried different combinations of this
statement... never made it work... I am wondering whether it should be
done
somewhere other than control source, or the reference to the field is
incorrect... please help.
 
F

fredg

= sign is automatically put ... so that was not the issue.
i.e.
=switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is the field name in the db2 table which form is reading from...

BruceM said:
As the Control Source for a text box you would need an = sign in front of
the expression. However, maybe there is a problem elsewhere. What do you
mean when you say that [CHN_CD] is a data field? The data type is defined
in table design view. Is it text, number, or what exactly?

gina said:
I have a form retrieving data from db2, and I want to convert code values
to
description. I tried to use Control Source and

switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is from data field... I tried different combinations of this
statement... never made it work... I am wondering whether it should be
done
somewhere other than control source, or the reference to the field is
incorrect... please help.

You still haven't answered the question as to what the [CHN_CD]
datatype is.
Is it a Number datatype or Text?
Is it included in the recordsource of the form?
What does "Never made it work" mean?
Do you get an incorrect value?
An #Error is displayed in the box?
No value?
What?
 
G

gina

data type is char(2)
I get #Error
Never made it work => I tried IIf statement, etc. and didn't work either.

I created the form using form wizard, and selected this field from the table
to be on the form.
Hope this helps you to answer my question. thanks!


fredg said:
= sign is automatically put ... so that was not the issue.
i.e.
=switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is the field name in the db2 table which form is reading from...

BruceM said:
As the Control Source for a text box you would need an = sign in front of
the expression. However, maybe there is a problem elsewhere. What do you
mean when you say that [CHN_CD] is a data field? The data type is defined
in table design view. Is it text, number, or what exactly?

I have a form retrieving data from db2, and I want to convert code values
to
description. I tried to use Control Source and

switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is from data field... I tried different combinations of this
statement... never made it work... I am wondering whether it should be
done
somewhere other than control source, or the reference to the field is
incorrect... please help.

You still haven't answered the question as to what the [CHN_CD]
datatype is.
Is it a Number datatype or Text?
Is it included in the recordsource of the form?
What does "Never made it work" mean?
Do you get an incorrect value?
An #Error is displayed in the box?
No value?
What?
 
B

BruceM

Open the table in design view. Next to the Field Name column is a Data Type
column. What is the data type for the field CHN_CD?

gina said:
data type is char(2)
I get #Error
Never made it work => I tried IIf statement, etc. and didn't work either.

I created the form using form wizard, and selected this field from the
table
to be on the form.
Hope this helps you to answer my question. thanks!


fredg said:
= sign is automatically put ... so that was not the issue.
i.e.
=switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is the field name in the db2 table which form is reading
from...

:

As the Control Source for a text box you would need an = sign in front
of
the expression. However, maybe there is a problem elsewhere. What do
you
mean when you say that [CHN_CD] is a data field? The data type is
defined
in table design view. Is it text, number, or what exactly?

I have a form retrieving data from db2, and I want to convert code
values
to
description. I tried to use Control Source and

switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is from data field... I tried different combinations of this
statement... never made it work... I am wondering whether it should
be
done
somewhere other than control source, or the reference to the field is
incorrect... please help.

You still haven't answered the question as to what the [CHN_CD]
datatype is.
Is it a Number datatype or Text?
Is it included in the recordsource of the form?
What does "Never made it work" mean?
Do you get an incorrect value?
An #Error is displayed in the box?
No value?
What?
 
G

gina

I don't see anything that looks like a data type in the design view.
the form design looks like
form header
Detail
greyed box with column_name and white box with column_name
form footer

how can I see data types?

BruceM said:
Open the table in design view. Next to the Field Name column is a Data Type
column. What is the data type for the field CHN_CD?

gina said:
data type is char(2)
I get #Error
Never made it work => I tried IIf statement, etc. and didn't work either.

I created the form using form wizard, and selected this field from the
table
to be on the form.
Hope this helps you to answer my question. thanks!


fredg said:
On Fri, 3 Aug 2007 10:14:05 -0700, gina wrote:

= sign is automatically put ... so that was not the issue.
i.e.
=switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is the field name in the db2 table which form is reading
from...

:

As the Control Source for a text box you would need an = sign in front
of
the expression. However, maybe there is a problem elsewhere. What do
you
mean when you say that [CHN_CD] is a data field? The data type is
defined
in table design view. Is it text, number, or what exactly?

I have a form retrieving data from db2, and I want to convert code
values
to
description. I tried to use Control Source and

switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is from data field... I tried different combinations of this
statement... never made it work... I am wondering whether it should
be
done
somewhere other than control source, or the reference to the field is
incorrect... please help.



You still haven't answered the question as to what the [CHN_CD]
datatype is.
Is it a Number datatype or Text?
Is it included in the recordsource of the form?
What does "Never made it work" mean?
Do you get an incorrect value?
An #Error is displayed in the box?
No value?
What?
 
B

BruceM

Open the *table* in design view. Not the form, but the table that contains
the field CHN_CD.

gina said:
I don't see anything that looks like a data type in the design view.
the form design looks like
form header
Detail
greyed box with column_name and white box with column_name
form footer

how can I see data types?

BruceM said:
Open the table in design view. Next to the Field Name column is a Data
Type
column. What is the data type for the field CHN_CD?

gina said:
data type is char(2)
I get #Error
Never made it work => I tried IIf statement, etc. and didn't work
either.

I created the form using form wizard, and selected this field from the
table
to be on the form.
Hope this helps you to answer my question. thanks!


:

On Fri, 3 Aug 2007 10:14:05 -0700, gina wrote:

= sign is automatically put ... so that was not the issue.
i.e.
=switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is the field name in the db2 table which form is reading
from...

:

As the Control Source for a text box you would need an = sign in
front
of
the expression. However, maybe there is a problem elsewhere. What
do
you
mean when you say that [CHN_CD] is a data field? The data type is
defined
in table design view. Is it text, number, or what exactly?

I have a form retrieving data from db2, and I want to convert code
values
to
description. I tried to use Control Source and

switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is from data field... I tried different combinations of
this
statement... never made it work... I am wondering whether it
should
be
done
somewhere other than control source, or the reference to the field
is
incorrect... please help.



You still haven't answered the question as to what the [CHN_CD]
datatype is.
Is it a Number datatype or Text?
Is it included in the recordsource of the form?
What does "Never made it work" mean?
Do you get an incorrect value?
An #Error is displayed in the box?
No value?
What?
 
G

gina

Data Type is "Text" with Field Size 2

BruceM said:
Open the *table* in design view. Not the form, but the table that contains
the field CHN_CD.

gina said:
I don't see anything that looks like a data type in the design view.
the form design looks like
form header
Detail
greyed box with column_name and white box with column_name
form footer

how can I see data types?

BruceM said:
Open the table in design view. Next to the Field Name column is a Data
Type
column. What is the data type for the field CHN_CD?

data type is char(2)
I get #Error
Never made it work => I tried IIf statement, etc. and didn't work
either.

I created the form using form wizard, and selected this field from the
table
to be on the form.
Hope this helps you to answer my question. thanks!


:

On Fri, 3 Aug 2007 10:14:05 -0700, gina wrote:

= sign is automatically put ... so that was not the issue.
i.e.
=switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is the field name in the db2 table which form is reading
from...

:

As the Control Source for a text box you would need an = sign in
front
of
the expression. However, maybe there is a problem elsewhere. What
do
you
mean when you say that [CHN_CD] is a data field? The data type is
defined
in table design view. Is it text, number, or what exactly?

I have a form retrieving data from db2, and I want to convert code
values
to
description. I tried to use Control Source and

switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is from data field... I tried different combinations of
this
statement... never made it work... I am wondering whether it
should
be
done
somewhere other than control source, or the reference to the field
is
incorrect... please help.



You still haven't answered the question as to what the [CHN_CD]
datatype is.
Is it a Number datatype or Text?
Is it included in the recordsource of the form?
What does "Never made it work" mean?
Do you get an incorrect value?
An #Error is displayed in the box?
No value?
What?
 
B

BruceM

Is it "01", "02", etc. or is it "1", "2". The reason I ask is that I can't
see a reason why Switch won't work. If you set the text box control source
to =[CHN_CD] to you see the correct value?

gina said:
Data Type is "Text" with Field Size 2

BruceM said:
Open the *table* in design view. Not the form, but the table that
contains
the field CHN_CD.

gina said:
I don't see anything that looks like a data type in the design view.
the form design looks like
form header
Detail
greyed box with column_name and white box with column_name
form footer

how can I see data types?

:

Open the table in design view. Next to the Field Name column is a
Data
Type
column. What is the data type for the field CHN_CD?

data type is char(2)
I get #Error
Never made it work => I tried IIf statement, etc. and didn't work
either.

I created the form using form wizard, and selected this field from
the
table
to be on the form.
Hope this helps you to answer my question. thanks!


:

On Fri, 3 Aug 2007 10:14:05 -0700, gina wrote:

= sign is automatically put ... so that was not the issue.
i.e.
=switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is the field name in the db2 table which form is reading
from...

:

As the Control Source for a text box you would need an = sign in
front
of
the expression. However, maybe there is a problem elsewhere.
What
do
you
mean when you say that [CHN_CD] is a data field? The data type
is
defined
in table design view. Is it text, number, or what exactly?

I have a form retrieving data from db2, and I want to convert
code
values
to
description. I tried to use Control Source and

switch([CHN_CD]="01", "FLS", [CHN_CD]="02", "ONL")

[CHN_CD] is from data field... I tried different combinations
of
this
statement... never made it work... I am wondering whether it
should
be
done
somewhere other than control source, or the reference to the
field
is
incorrect... please help.



You still haven't answered the question as to what the [CHN_CD]
datatype is.
Is it a Number datatype or Text?
Is it included in the recordsource of the form?
What does "Never made it work" mean?
Do you get an incorrect value?
An #Error is displayed in the box?
No value?
What?
 
Top