How to Track Historical Product Prices and Effective Dates in Access
Question details
The user needs a method to retain historical product prices and their effective dates in Microsoft Access rather than overwriting existing records when a price changes.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Updating product pricing in a database while maintaining a complete audit trail of previous prices and the dates they were active.
- Observed behavior
- The user wishes to implement a relational database structure that inserts new price records instead of overwriting old ones, and dynamically displays the most recent price.
Before modifying your database structure, ensure you have backed up your Access database file to prevent accidental data loss while creating new tables and relationships.
Create a Related Pricing Table and Use DLookup
Separate your product details from the pricing history to maintain a comprehensive record of all price changes over time.
Overwriting prices destroys historical data. By creating a dedicated pricing table, you can store every price change as a new row. To find the current active price, you query the record with the latest effective date using domain aggregate functions.
In Access, create a new table named 'ProductPrices' containing the fields ProductID, EffectiveDate, and UnitPrice. Set the combination of ProductID and EffectiveDate as a composite primary key to ensure only one price exists per product per day.
Navigate to Database Tools > Relationships. Link your main 'Products' table to the 'ProductPrices' table by establishing a one-to-many relationship using the ProductID field.
On your main form, use the DMax function to find the most recent EffectiveDate for a specific product, and wrap it in a DLookup function to retrieve the corresponding UnitPrice for display.
Build a separate dialog form specifically for entering new prices. Because queries using aggregate functions like MAX are not updatable, this dedicated form prevents locked record issues.
Add a save button to the dialog form. Attach VBA code or a macro to the button's OnClick event that executes an SQL INSERT query: INSERT INTO ProductPrices (ProductID, EffectiveDate, UnitPrice) VALUES (...). Finally, requery the main form to reflect the newly inserted price.

Discover WPS Office for Your Data Management Needs
While WPS Office does not feature a relational database tool like Microsoft Access, its powerful Spreadsheet application excels at managing, analyzing, and tracking flat-file data, including pricing histories. It serves as a highly compatible, free, and lightweight alternative for your daily office tasks.

Frequently Asked Questions
Why shouldn't I just overwrite the old price in my Access table?
Overwriting the price permanently deletes the historical pricing data. This makes it impossible to audit past sales, reprint historical invoices accurately, or analyze pricing trends over time.
How do I fix the 'Recordset is not updatable' error when using MAX for prices?
Queries using aggregate functions like MAX are inherently read-only in Access. To resolve this, display the latest price using DLookup and DMax on your main form, and use a separate pop-up dialog form utilizing an INSERT INTO statement to add new price records.
Can I track price history in a spreadsheet instead of a relational database?
Yes. You can maintain a flat-file database in a spreadsheet like WPS Spreadsheet by keeping a continuous list of products, prices, and effective dates. You can then use PivotTables or lookup functions like XLOOKUP combined with MAXIFS to dynamically extract the most recent price.




