Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Computation using form

Status
Not open for further replies.

JennieFernandes

Programmer
Aug 4, 2005
10
US
I have a table with a set of records: FiscalYear, CompanyName, Item1Price, Item2Price

The table has this information for the year 2004. I want the form to update the information in the table for FiscalYear 2005 onwards. The Item1Price increases by 10% every year and Item2Price increases by 20% each year. I also want the capability to allow the user to enter the information if he/she doesnt want to the 10% increase every year.

I would like some suggestions on how to do this.

Jennie
 
How far have you gotten? What works? What doesn't work?

What is your table structure? Please list fields, data types, and sample data.

You could do something like this:
1) Run an update query to enter the Item1Price for any records where FiscalYear = 2005 and Item1Price is null (you don't want to write over any amounts someone may have already entered).

2) do the same thing for Item2Price

3) On your form, put text boxes for these fields. Users may edit as they wish.



Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
If you're trying to create a new price file, create an append query to take every record from the table with a fiscal year of 2004 and append it to the table with a fiscal year of 2005 and the prices increased by 10%. For example:
Code:
INSERT INTO tblPrices ( FiscalYear, CompanyName, Item1Price, Item2Price )
SELECT 2005 AS NewFiscalYear, CompanyName, Item1Price*1.1 AS NewItem1Price, Item2Price*1.2 AS NewItem2Price
FROM tblPrices;

[shadeshappy] Cruising the Information Superhighway
(your mileage may vary)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top