View Full Version : Conditional Field in Query


Melodie
11-13-2009, 01:55 AM
I need to do something quite simple and have tried many solutions from code in various forums to no avail.

I have a customer details table, one field is a combo with type of membership field 'membtype' and can only be Gold, Silver or Bronze.

I then have a query with all the customer details including this 'membtype' field.

I want another 'cost' field that inputs the cost of each of the membership types automatically based on the membtype field. Gold = 350 Silver = 280 Bronze = 210.

What is the simplest way of doing this that works?

Thanks

namliam
11-13-2009, 02:11 AM
The simplest way is NOT DO IT!

The cost is associated with the membership type, thus should be in the Membership type table where it can be related from without problem.

Melodie
11-13-2009, 02:21 AM
mmm.... I could put the cost straight in, but I would still need a mail merge letter with Gold Silver or Bronze membership which would be dependant on the 'cost' field.

Also at POS - if offering Gold, Silver or Bronze membership, therte are less likeley to be mistakes if the membtype is inputed as such, rather than money.

namliam
11-13-2009, 02:52 AM
You can have the Gold/Silver/Bronze be the data entry no problem, I am just saying you should (on customer level) store the cost of it.

The cost is part of the membership type, as such should be stored there... not at customer level.

GalaxiomAtHome
11-13-2009, 02:53 AM
The MemberType table should have three fields.
MemberTypeID, TypeName, Cost

On your form use a combobox which provides the ID for the customer record, displays the TypeName and does whatever you want with the cost.

So you select the TypeName but the other information is also available to the form.

Melodie
11-13-2009, 03:37 AM
Of course - sorry - I am stupid - I used to (10 yrs + ago) do a lot with Access but have now forgotten the basics.

Thanks for putting me straight

Melodie