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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent form or report from being updated

Status
Not open for further replies.

pdtit

Technical User
Nov 4, 2001
206
BE
Hi,

I have a small invoice application with a form and a report to enter and display my data.

Is it possible to prevent both form and report from being updated with new data ?

What I mean is :

For each month, I have an "hourly rate" to calculate the amount of services hours to be invoiced.
As I will change my prices as of next week with +5%, I need to update my table. So far, no problem.

However, when I change the price and reopen my form/report with an invoice from begin this year January, it displays me the total +5% as well.

The information displayed on the form and report is based on a query. It should be possible to "harcode" the data into the form once it is approved for payment.

Regards,

Peter
 
Sounds like you need to have some date range fields in your Price table, i.e.

PriceStart PriceEnd Price
6/1/04 12/31/04 $20.00
1/1/04 5/30/04 $21.00

then use those date ranges in your calculations.

Another option is to have fields in your table (wherever your 'final' data is) where when someone clicks an INVOICE button or whatever you're doing, it does the calculation and saves it in the table.
 
Ginger,

Thanks for your fast reply.

Option 2 sound interesting to me; could you please guide me on how to store the calculations made on the form into a table?

Regards,

Peter
 
i personnaly think the first way is better, but we'll give it a shot. first make a new field in your table. I'm not sure where since you don't give details of your table structure. then say you have an Invoice form. Maybe you are doing something like "PRINT INVOICE" or "FINAL INVOICE" or something that indicates to the db that THIS IS THE FINAL COMPLETED INVOICE FOR ALL TIME. in the OnClick event of that button, write code which does those calculations and stores them in your table. something like
Code:
'Open the Invoice Table for the current InvoiceID
dim rs as dao.recordset
set rs = currentdb.openrecordset("SElect * from tblInvoice where InvoiceID = " & me.InvoiceID)

'Fill in the new field with calcuations
rs.edit
rs!InvoiceTotal = me.InvoiceTotal
rs.update
set rs = nothing

again, since I don't know how you have things set up, you'll have to fiddle with it.

g


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top