Stock Update

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please help me

In my database there is 2 tables, named "MasterStock" and "Voucher".


MasterStock
--------------
StockId (autonumber) - Key field
SotckDate (date)
BeginingNo (Text) - (10 charectors) format "0000000000"
Quantity (Number)- 0 decimal

Voucher
----------
VoucherNo (Text) - (10 charectors) format "0000000000" - Key field
StockId (Number) -duplicates - OK

Here we want to update Voucher table based on the data in MasterStock.
For example, We are inputing Begining number and Quantity in a form, it
should check if any voucher existing in "Voucher" table within this criteria
by a loop. If not, add to "Voucher" until the quantity met.

Please help me in this case...

Thanks in advance
 
Here we want to update Voucher table based on the data in MasterStock.
For example, We are inputing Begining number and Quantity in a form,
it should check if any voucher existing in "Voucher" table within this
criteria by a loop. If not, add to "Voucher" until the quantity met.

I think you mean by this that the MasterStock.Quantity is meant to reflect
the number of Voucher records referencing that MasterStock record.

Bad Idea.

If you want to know how many Vouchers you have, simply count them: either
using a DCount() function, or, better, by joining the tables together and
using a COUNT aggregate function in the query. You just will not be able to
keep the two values in synch. What will you believe when you have two
different counts for the same thing?

Hope that helps


Tim F
 
Back
Top