Track Inventory by Lot and Expiry Date in Microsoft Access
Question details
Design an Access inventory database that tracks stock separately for each lot and its expiry date.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- The user needs to record receipts and issues for individual batches of the same product.
- Observed behavior
- Available inventory should be calculated by lot rather than stored only as an aggregate product quantity.
Review your existing product and inventory tables to identify where item quantities are stored. Decide how you will identify each lot and whether quantities can include fractions.
Create lot-linked inventory tables and a stock balance query
Use separate product, lot, and transaction records to calculate the available quantity for each batch.
Record receipts as positive quantities and issues as negative quantities. The sum of transactions for a lot is its available balance.
This design calculates stock by lot, but it does not automatically prevent users from issuing more than is available. Add validation or a controlled transaction process if that protection is required.
In Access, select Create > Table Design. Add a ProductID AutoNumber primary key and fields such as ProductName, then save the table as Products.
Select Create > Table Design and add a LotID AutoNumber primary key, a ProductID Number field with Field Size set to Long Integer, a LotNumber Short Text field, and an ExpiryDate Date/Time field. Save the table as Lots.
Create an InventoryTransactions table with a TransactionID AutoNumber primary key, a LotID Number field with Field Size set to Long Integer, a TransactionDate Date/Time field, and a signed Quantity field using a number type suited to your units. Enter receipts as positive quantities and issues as negative quantities.
Open Database Tools > Relationships and add the three tables. Link Products.ProductID to Lots.ProductID and Lots.LotID to InventoryTransactions.LotID, selecting Enforce Referential Integrity for each relationship.
Open the Lots table and add a record for each batch, including its product, lot number, and expiry date. In InventoryTransactions, enter a separate receipt or issue against the corresponding LotID, including any opening stock as a positive transaction.
Select Create > Query Design and add Products, Lots, and InventoryTransactions. Add ProductName, LotNumber, ExpiryDate, and Quantity to the grid, select Totals, and set Quantity to Sum while leaving the other fields as Group By. Run the query to see the balance for each lot with transactions.

Track small lot inventories in WPS Spreadsheets
WPS Office is a free, lightweight alternative with a familiar interface and Excel-compatible files for a smoother move from Microsoft Office. Use WPS Spreadsheets to maintain a simple lot and expiry register; it does not replace Access relational database features or directly manage Access databases.

Frequently Asked Questions
Why should each lot have its own record?
Separate records in the Lots table let the same product have multiple lot numbers and expiry dates. Each transaction can then reference the exact LotID it affects.
How do I reduce stock for a specific lot?
Add an issue record to InventoryTransactions with that lot's LotID and a negative Quantity. The totals query subtracts it from the lot's receipts.
How can I find lots that expire soon?
In Query Design, include ExpiryDate and add a suitable date range in its Criteria row. Run the query and sort ExpiryDate in ascending order.
Will the totals query prevent negative stock?
No. The query reports the sum of recorded transactions but does not block an issue that exceeds the available balance. Use a controlled transaction process with validation if negative stock must be prevented.
Can WPS Office replace the Access database?
WPS Spreadsheets can maintain a simple lot register in an Excel-compatible workbook, but it does not provide Access relational database features or directly manage Access databases.




