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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IF THEN statements

Status
Not open for further replies.

baudouxnorthrup

Technical User
Feb 19, 2003
16
US
Is there such a thing as IF Then statements in Access?

I am creating a db from an elaborate Excel Spreadsheet.
This has a field, probability of success, which is either 100, 80, 50 or 10. The person then used fields to assign 100 a rate of 9, 80-6, 50-3 and 10-0. How do I write an expression to convert 100, 80, 50 or 10 to 9,6,3 or 0?

I need to have the calc so that the person doesn't have to go in and change alot of fields if things change.
 
Have a look at the IIF statement. It works something like

Iif(fieldname = 100, value, else-part)

To nest it then you can just put another IIF statement in the else part. So you might have something like

Iif(fieldname = 100, 9, iif(fieldname=80,6, iif(fieldname=50,3,0)))

Hope this helps.

Mark

The key to immortality is to make a big impression in this life!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top