M
Mareo
I have two fields in a record in access 2002. I want to
calculate the value in Field2 with a different constant
based on what is in Field1.
Field 1 Field 2
PCBs 2.3
Pesticides 10.5
Zinc 400
PCBs 3.2
Zinc 330
etc etc
. .
. .
If Field1 is Pcbs then I want to calc Field2 as
2.3/constant1
If Field1 is Pesticide then I want to calc Field2 as
10.5/constant2
If field1 is Zinc then I to calc Field2 as 400/constant3
How do I write a module to perform this task?
I have tried the switch funtion but get a syntax problem.
Field 2: Switch ([Field1] = "Pcbs", [Field2]/constant1,
[Field1]= "Pesticides", [Field2]/constant2, [Field1]
= "Zinc", [Field2]/constant3, True, Null)
calculate the value in Field2 with a different constant
based on what is in Field1.
Field 1 Field 2
PCBs 2.3
Pesticides 10.5
Zinc 400
PCBs 3.2
Zinc 330
etc etc
. .
. .
If Field1 is Pcbs then I want to calc Field2 as
2.3/constant1
If Field1 is Pesticide then I want to calc Field2 as
10.5/constant2
If field1 is Zinc then I to calc Field2 as 400/constant3
How do I write a module to perform this task?
I have tried the switch funtion but get a syntax problem.
Field 2: Switch ([Field1] = "Pcbs", [Field2]/constant1,
[Field1]= "Pesticides", [Field2]/constant2, [Field1]
= "Zinc", [Field2]/constant3, True, Null)