Results 1 to 5 of 5
  1. #1
    ghallourim is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2021
    Posts
    3

    How To Prevent Data Integrity From Changing Data In A saved Form Records

    Hi


    I Have A Purchase Invoice Form For Products I bought For My Shop, That Contains a WholSale Price Field, the wholesale price field is taken from A product table, the wholesale prices are changing all the time, so the problem is when I enter a new wholesale price in a new Purchase invoice records is changing in all the old purchase invoices records, so what I want is a way to can save or freeze the old records from changing.

    Click image for larger version. 

Name:	Capture d’écran 2021-12-21 235935.png 
Views:	14 
Size:	21.5 KB 
ID:	46909

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,425
    Your current price field for items should reflect exactly that. The table that records the quantity sold/bought and the price should use the price at the time of the transaction. You don't link this field to the item's current price field, you store the value that was the price at the time, along with the quantity (in a separate field). Your form/report then calculates the line item cost by multiplying the qty by the price at the time; e.g. qty 5 x $100 = $500. It's key that you don't store the $500 value anywhere. If you apply discounts based on some condition such as quantity discounts there is likely more than one approach you can use, such as including the discount rate in the calculation.

    You might want to review this for some tips
    http://allenbrowne.com/AppInventory.html
    Last edited by Micron; 12-21-2021 at 05:11 PM. Reason: clarification
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    ghallourim is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2021
    Posts
    3
    Quote Originally Posted by Micron View Post
    Your current price field for items should reflect exactly that. The table that records the quantity sold/bought and the price should use the price at the time of the transaction. You don't link this field to the item's current price field, you store the value that was the price at the time, along with the quantity (in a separate field). Your form/report then calculates the line item cost by multiplying the qty by the price at the time; e.g. qty 5 x $100 = $500. It's key that you don't store the $500 value anywhere. If you apply discounts based on some condition such as quantity discounts there is likely more than one approach you can use, such as including the discount rate in the calculation.

    You might want to review this for some tips
    http://allenbrowne.com/AppInventory.html
    this is not working with me because the wholesale price have a lot of relationship with other form and queries And I want to Keep That

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,425
    Well, I have no idea what that looks like so I guess I'll have to defer to the wisdom of other responders. You might find that you'll have to elaborate on what those constraints are in order to get focused help.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    As has been suggested, readers need to see more of your database. Your table designs, a description of the business/processes involved.You may get some insight from this post.

    If you search the forum with "AgreedTo", you'll get a few posts/threads that deal with issues of History of Prices. Product prices change, so you can not rely on the Product price in the Product table to be constant/reliable with time.

    We really need to see more of your requirement in business terms.
    Good luck.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 03-25-2021, 09:01 AM
  2. Prevent edit or delete data or records from a table
    By mosquito_admin in forum Security
    Replies: 1
    Last Post: 03-01-2012, 06:02 PM
  3. Replies: 1
    Last Post: 12-21-2011, 02:11 PM
  4. Replies: 3
    Last Post: 10-14-2011, 08:52 AM
  5. changing data in many records
    By cforce in forum Programming
    Replies: 1
    Last Post: 07-22-2010, 02:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums