Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting one value from many in a querry field

Status
Not open for further replies.

billheath

Technical User
Mar 17, 2000
299
US
I need a criteria expresion which will allow the selection of any one of five fields in one table depending on the value of a criteria field in a second table.
For instance, the fields are field1, field2, field3, field4 and field5. Depending on the criteria field, ([Area]), from a second table, I want to insert one of the 5 fields. I tried a nested iif function statement, but access keeps giving me an error. I can use the iif function to find one of two fields but it will not allow me to nest them.

I tried:
iif ([tbl 2]![area]=washer,[tbl 1]![Field1],iif ([tbl 2]![Area]='Plant",[tbl 1]![Field2],.......,[Field5])))))

Any suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top