Calculating in Access

  • Thread starter Thread starter Diana
  • Start date Start date
D

Diana

Hi,

I am producing an Access database to track inventory of
parts. I would like to have it automated so when parts
are removed (manually in one field) the in stock field
will automatically reduced the total. Thanks in advance.
Diana
 
-----Original Message-----
Hi,

I am producing an Access database to track inventory of
parts. I would like to have it automated so when parts
are removed (manually in one field) the in stock field
will automatically reduced the total. Thanks in advance.
Diana
.
Hi Diana,
you may find it useful to post a guestion in the database
design newsgroup for confirmation that your design is
optimum for your purpose...

With regard to this post, assuming that you have two
controls, txtQuantity and txtStockOnHand. Use the
following as an example (air code/requires testing):

Private Sub txtQuantity_AfterUpdate()
dim lngChange as long
with txtQuantity
' new value may amend existing value
lngChange=.value - .oldvalue
end with

with txtStockOnHand
..value=.value - lngChange
end with
end sub

Luck
Jonathan
 
Back
Top