Can I enter "if" "then" formulas in Access?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We own a dance competition and I am trying to build the database to enter the
entries we receive, into the computer. We have solos, which are $70 a piece,
duet/trios, which are $75 a piece and small, large and line groups, which are
$26 per person, per dance. How do I have Access calculate those numbers for
me, once the information is entered into a form?
 
MissBeth,
Please provide several examples of your calculations...
What fields you have, what you'll be entering, and the resulting calculation against
those entries.
 
It sounds like you should create a query, and the answer is yes, If-Then
statements are allowed. However, in a query, you'll have to use the function
IIF(criteria,true result,false result). So, if you have a field called dance
type, you'd create a calculated field with a statement like:

IIF([Type]='Solo',70,IIF([Type]='Duet/Trio',75,IIF([Type]='Group',26*[People])
))
 
Do I need to have a separate table for solos, duet/trios, small groups, etc,
and then do a query with all of those tables included? Do I enter the
statement on the query detail page? I am trying to learn this program
quickly and have just been fighting it for five days. Any help would be most
appreciated.

I have alot of information that will be stored in this database (entries
customers send in, reports feeding off of those entries - both for the
customers and our business, etc) and I HAVE to make sure it is correct. I
have worked previously for another dance company, so I know exactly what I
need, I just can't seem to make my computer read my mind.

kingston via AccessMonster.com said:
It sounds like you should create a query, and the answer is yes, If-Then
statements are allowed. However, in a query, you'll have to use the function
IIF(criteria,true result,false result). So, if you have a field called dance
type, you'd create a calculated field with a statement like:

IIF([Type]='Solo',70,IIF([Type]='Duet/Trio',75,IIF([Type]='Group',26*[People])
))
We own a dance competition and I am trying to build the database to enter the
entries we receive, into the computer. We have solos, which are $70 a piece,
duet/trios, which are $75 a piece and small, large and line groups, which are
$26 per person, per dance. How do I have Access calculate those numbers for
me, once the information is entered into a form?
 
Not necessarily, the calculation will work as posted. Just create a query
based on the data table and in a new entry for Field: enter the IIF statement
(Access will probably give it a field name like Expr1). Replace the field
and variables with your actual information. Of course I'm assuming that your
data table is set up with a field that lists the type (as recorded on your
form). You can use this statement in a form or report too if you wish.
Do I need to have a separate table for solos, duet/trios, small groups, etc,
and then do a query with all of those tables included? Do I enter the
statement on the query detail page? I am trying to learn this program
quickly and have just been fighting it for five days. Any help would be most
appreciated.

I have alot of information that will be stored in this database (entries
customers send in, reports feeding off of those entries - both for the
customers and our business, etc) and I HAVE to make sure it is correct. I
have worked previously for another dance company, so I know exactly what I
need, I just can't seem to make my computer read my mind.
It sounds like you should create a query, and the answer is yes, If-Then
statements are allowed. However, in a query, you'll have to use the function
[quoted text clipped - 9 lines]
 
Back
Top