Lock old prices from updating

Vicar

Registered User.
Local time
Yesterday, 23:47
Joined
Aug 9, 2005
Messages
13
Hi, please help if you can, i have searched the threads, but unfortunately didn't see anything close. Please point out if i missed some.

I am trying to lock or archive old records/invoices from updating when prices update for the same products/services.

Anyway of doing it a quick and dirty way perhaps?
U people rule! - built my entire system based on on your help threads/samples!

Thanks
V
 
This is a way to do it:

Add a flag in your table, call it 'Locked'.

When you want to 'lock' prices, set it's value to true (flag it).

In your form, add the flag you just created. You can make it visible or hide it, it doesn't matter.

On the field(s) you wish to lock when the flag is flagged on, add this code in the OnFocus()-property:

Code:
If Me.Locked_.Value = True Then
    Me.Value.Locked = True
Else
    Me.Value.Locked = False
End If

Good luck!

Seth
 
Vicar said:
Hi, please help if you can, i have searched the threads, but unfortunately didn't see anything close. Please point out if i missed some.

I am trying to lock or archive old records/invoices from updating when prices update for the same products/services.

Anyway of doing it a quick and dirty way perhaps?
U people rule! - built my entire system based on on your help threads/samples!

Thanks
V

This is one of the few exceptions to allowing redundant data. Since you need to freeze the price at the time of the transaction I would store the price in the transaction record.

The alternative is to add an effective date to the products table then match that to the date of the transaction to pull the correct price.
 
Just repeating what Scott has said.

When you produce an invoice, you use the current prices. if you tried to duplicate the exact same invoice in the future, and the current prices were different then the reproduction would not match the original.

It is quite common to discount items for particular customers, so even if the prices were current, if the customer had had a special deal for some reason, then the reproduction invoice would still be incorrect, even though the current prices were the same.

For these two reasons, it is usually a good idea to store the actual information shown on the invoice, and not rely on recalculating it at a later date.
 
Thank you Seth, Scott and Uncle Gizmo!
After finishing my current form (PO), i realized after testing that data selected is stored in the table and unless i go back to this form(i used cascading method for price field as well - :-) sort of breaker; it will keep originaly chosen price) and select changed price i am fine. Which won't happen since the data is eneterd once, and later used only table information for reporting purposes.

Thanks a lot,
Let me know if u thinks it's risky.
Thanks again - Learning curve is definetly steep using this forum - for newbies as myself.

V
 

Users who are viewing this thread

Back
Top Bottom