Combo Box Returning Values from Seperate Table (1 Viewer)

Italiafirenze

New member
Local time
Today, 17:56
Joined
Mar 30, 2008
Messages
2
Hi,

I have a database which I use to run a Car Sales business.

We use a sales form which enters all the relevant invoice information about the deal as it is done. You put in the relevant information e.g. Sale Price, Extras, Warranty Price, Deposit, Part-Exchange, Road Tax Price and then it calculates the total amount owing accordingly. All info about the car is already entered when the car is added to stock.

What I am looking for is instead of having to type in the relevant Road Tax Price in the field "RoadTaxPrice" a Combo box which will give a choice between 6 or 12 months tax and lookup the correct price in a table and when selected enter it into the field. The tax bracket that a car falls into varies depending on three factors, Date of Registration, Engine Capacity and CO2 emissions.

For non-uk members; If a car is registered before 01/03/2001 the road tax is based on engine capacity. If a car is registered after 01/03/2001 the road tax is based on CO2 emissions.

If the tax is based on emissions there are brackets A,B,C,D,E and F. If the car was registered after 23/03/2006 a band G also applies.

In most cases the price for 6 months is half of 12 months plus a 10% surcharge. Except for bands A and B. Band A is Free and Band B is £35 for 12 months and cannot be taxed for 6 months.

I have created a table to store the different pricing bands with the following fields:

ID, Name, CO2 Minimum value, EngineCC Minimum value, Date of Reg, Rate 6 months, Rate 12 months.

(These aren't field names just descriptions of what they contain)

If anyone can point me towards an obvious principle that would work for this that's great.

I searched for ages for a solution to looking up make and model until I found that what I wanted was called "Cascading Combo Boxes".

Any help appreciated. Many Thanks.
 
That's a lot of text. You have to get to the point more quickly or use a sample database to illustrate the problem.
 
You can use the "on change" event of the combobox to do anything, including that what you want...

Lookup some stuff and fill in some other stuff on the form.
 
have a combo box populated with just 6Mths/12Mths

(actually have value list 1;6Mths; 2;12Mths)

in the after update event for the combo box, i think you will then have to call a function based on this value, and the otrher parameters that calculate the RFL - as I dont think you will be able to get this directly from a table
 
have a combo box populated with just 6Mths/12Mths

(actually have value list 1;6Mths; 2;12Mths)

in the after update event for the combo box, i think you will then have to call a function based on this value, and the otrher parameters that calculate the RFL - as I dont think you will be able to get this directly from a table

Thats exactly what I want really, a combo to give me the option of 6 or 12 months.

The tricky bit is getting it to update the RFL price field with the correct value based on the table. How do I get it to check all three parameters?
 
call a function and check the values

ie in the after update event of the conbo box

put

rflamount = rflcalc(licenceduration, fueltype, emisisons, etc)

ie call a function with all the reuqired arguments

and then have a function

function rflcalc(arguments as required) as currency
{do the calc here)
end function
 

Users who are viewing this thread

Back
Top Bottom