If "Column" cell = Text the Column "Cost" will be updated

M

Mark909

Basically what im trying to do is that if the Object Type in one column
contains different types of objects then a new column called cost will be
updated displayed the cost of the different objects.

I guess itll be somewhere alongs the lines of:

If [Object Type] = "FW2" then [Cost] will equal £300; If [Object Type] =
"FW4" then [Cost] will equal £400; If [Object Type] = "CW2" then [Cost] will
equal £350; etc; etc

Im really new to Access so still trying to get the hang of queries. Will I
need to create a seperate table with the costs of each item time then link it
to create a new query?
 
T

Tom van Stiphout

On Wed, 17 Dec 2008 03:16:05 -0800, Mark909

Sounds like ObjectType (lose the spaces; they're going to be a
hindrance) is very similar to Product in many sample applications like
Northwind. Each Product has a ProductName and a Price. When a Product
is selected for an Order, this is done by creating an OrderDetail
record with OrderID, ProductID, Price in it, among other fields. Study
the sample databases, and let your brain work to find the analogies
with your application.

-Tom.
Microsoft Access MVP
 
B

BruceM

You may be able to use the Switch function (Help has more information about
it). However, it looks to me as if you need a table for ObjectType, which
as Tom observed seems analogous to Product. As it stands it looks as if you
will need to update your code for every future price change. If so, it
would be much better to store the values in a table.
 

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