[AccessD] lock data2

Stuart McLachlan stuart at lexacorp.com.pg
Thu Apr 28 17:02:20 CDT 2005


On 28 Apr 2005 at 23:01, Pedro Janssen wrote:

> Hi,
> 
> this problem was badly explained, so i will try again.
> 
> I have a table in which data about bricks and their prices are stored.
> I use this data in a form where the orders of these bricks are stored. The
> prices of the bricks are used only as lookup (the price can't be changed by
> hand on this form).
> The prices in this form are used to make bills by mail merge with word.
> When the price of a brick (for example A)  changes and the price in the
> table for brick A is will be changed to.
> When opening the order form and changing other data in the order for brick A
> the original price will be updated with the new price.
> How can i prevent this. When i place a order, the price at the date of the
> order must stay on the form, even when the price of this brick is changed in
> the table.
> 

You need to have a Price field in the Order table  and store the price at 
the time the order is first created.  

Assuming you are picking order items off a combo box, include the current 
price as a column in the combo. Display the OrderPrice on your order form 
and set it OrderPrice from the combobox  CurrentPrice column in the combo 
on_change event.  

You should also include some sort of validation to avoid inadvertently 
updating the price later. Something along the lines of:

If  NZ(OrderValue.OldPrice,0) <> O  AND OrderPrice.OldValue <> OrderPrice 
Then
	If MsgBox('Confirm you want to change the Price of this item...........



-- 
Stuart





More information about the AccessD mailing list