Access 2002

  • Thread starter Thread starter Mareo
  • Start date Start date
M

Mareo

I have two fields in a record.

Field 1 Field 2
PCBs 2.3
Pesticides 10.5
Zinc 400

If Field1 is Pcbs then I want to calc Field2 as 2.3/2.1
If Field1 is Pesticide then I want to calc Field2 as
10.5/12
If field1 is Zinc then I to calc Fielf2 as 400/410

How do I write a module to perform this task?
 
I have two fields in a record.

Field 1 Field 2
PCBs 2.3
Pesticides 10.5
Zinc 400

If Field1 is Pcbs then I want to calc Field2 as 2.3/2.1
If Field1 is Pesticide then I want to calc Field2 as
10.5/12
If field1 is Zinc then I to calc Fielf2 as 400/410

How do I write a module to perform this task?

No module is needed: just put a calculated field in a Query

Field 2: Switch([Field 1] = "PCBs", 2.3/2.1, [Field 1] = "Pesticides",
10.5/12, [Field 1] = "Zinc", 400/410, True, NULL)
 
Back
Top