<%dim crumb crumb="Inventory Calculations Single-User" Crumb2="Inventory Calculations in Visual Basic" crumb1="Inventory Data Management Method Download" %> Inventory Calculations Example - Single User Databases
Home  Fees/Services  Access 2010 Template  Access Tutorial  Access Download  Articles  Search  Contact  Privacy  Links

<%if len(crumb2)>2 then response.write crumb2 else response.write ">

Open Email Using SendObject Access Download

User Inactivity Logout VBA Code

Disable Shift Key Demo

Send Email Microsoft Access Tutorial Download (Advanced)

Sequential Counter in Query

Multi Select List Box Query Parameters

Row Level Data Security

Programming MS Access Security Alternative

Single User Inventory Calculations Download

How To Perform Multi-User Inventory Calculations

Make Dependent Combo Box Code MS Access Tutorial

Union Query Example (Simple)

Union Query (Advanced) Access Tutorial

How To Fill Fields From Combo Box

Use Global Variables as Parameters

Continuous Form Dependent Combo Box

How To Program Continuous-Continuous Master/Detail Forms

Access Bar Chart / Bar Graph

Programming Crosstab Query Example

TransferText & OutputTo Microsoft Access

DoCmd.OpenForm & OpenArgs VBA Example

Running Sum Query Method

Choose Command Dynamic SQL Order By

Access Conditional Format

Access Report Banding

Popup Form Control Method

<% gnum="5519700534" %>

Increment/Decrement Inventory Values

Inventory Database Calculations Example

Custom Inventory software is the most widely requested type database for our programmers. In this Access database example download we demonstrate the simplest method for calculating inventory totals when creating purchase order or similar Access forms. This Access database download shows how you can use the Docmd.Runsql statement in the after update (afterupdate) event to increment and decrement inventory totals. The methods demonstrated here are only suitable for single-user database systems since the code does not take into account the possibility of locked table records.

The following code is run from the Access database example:

Option Compare Database
Public hold_qty As Long

Private Sub Qty_Out_AfterUpdate()
DoCmd.RunSQL "Update M_Inventory set inv_qty=inv_qty+" & Nz(hold_qty, 0) & " where barcode=" & Me.BarCode
DoCmd.RunSQL "Update M_Inventory set inv_qty=inv_qty-" & Nz(Me.Qty_Out, 0) & " where barcode=" & Me.BarCode
End Sub

Private Sub Qty_Out_Enter()
hold_qty = Me.Qty_Out
End Sub

The inventory calculations method shown in this example should only be considered for a one-user inventory system.  Consider using transaction processing for these types of calculations in a multi-user database so that record locking and update failures can be tracked to increase database integrity and inventory calculation accuracy.  Download the Access 2000 Inventory Calculations Example.

Inventory Calculations Access Download

Our Access transaction processing  example demonstrates performing multiple database update actions and assuring that either all or non of the updates get completed.  Here's a like to our transaction processing example.

Microsoft Office:
MS Access 2003
Access 2007
Access 2010
Access 2013
Access 2016
<% dim rnum Randomize rnum = Int(Rnd * 10) + 1 response.write " Updated On " & now-rnum %>

Contact Information

<% Response.write "Copyright 2000-" & year(now) & " Blue Claw Database Design" %>

MS Access 2013, Access 2010 & Microsoft Office 2007