Do calculation ???

J

Joe

Hi, all,

I am a newbie of Ms Access.

My boss needs me to develop a small-scaled Ms Access 2002 application that
to store and do some calculation of the cost (printing).

That means I provide a Form for user to input records (printing material,
vendor, customer, jobs¡K).

Because there are different combinations of calculation method, such as
print 1-500 pages for $A, print 501-1000 for $A * 1.8 ¡K¡K.Also different
price for color and black and etc.

So I don¡¦t want to hardcode the equation in the query, I had use a table to
store the equation. Following are the table structure


Table: BASE_PRICE

Category | Price
===========
A | 10
B | 20


Table: EQUATION

From | To | multiple
===============
1 | 500 | 1
501 | 1000 | 1.8
1001 | 1500 | 2.7

I want to let user to input the no. of page and category in Form and then
the application search the equation & base_price table that it within which
group and do calculation.

For example, if user select category [A] and input 550 for pages, so it
means $10 * 1.8 = $18.

So I want to know that can Ms Access do that?

Thx for your attention !

Joe
 
D

dva

You can try creating a form with 2 text boxes named "categ" (to enter the
category) and "quantity" (to enter the quantity). Then add another button to
execute the following query.

SELECT BASE_PRICE.price * EQUATION.Multiple
FROM BASE_PRICE, EQUATION
WHERE (((BASE_PRICE.category)=[categ]) AND ((EQUATION.From)<=[quantity]) AND
((EQUATION.To)>=[quantity]));

Of course you have to make some checks first to make sure that the category
and quantity the user enters, are valid.

Hope it helps.
 

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

Top