Access 2002

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?
 
J

John Vinson

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Module 1
Update Query question 2
Customized display order for fields 1
access form 1
do loop through a table 2
how to write vb code in access 2007 2
Shift several columns in table 4
sort nonnumeric fields 7

Top