Please help me to solve this problem.

veasna

Registered User.
Local time
Today, 03:43
Joined
Dec 21, 2009
Messages
18
Dear Access Programmer,

I am a new in Access. Here are the description of my problems:
- I have two tables: TblBook that has fields "BookId, BookName, BookQty" and TblBorrow that has fields "BorrowId, BookId, BorrowBookQty, BorrowDate".
- In FormBook i have a subform name "Book subform".
- In FormBorrow i have a subform name "Borrow subform".
- When i select the BookId and enter BorrowBookQty in the table TblBorrow, the BookQty in table TblBook must minus too.

How can i deal with this? Could you please give me some idea?

Thanks,
Veasna
 
Don't store the quantity of books on hand.
Store the initial number of books.

Calculate the on hand figure in the Record Source query of the form by subtracting the total number of outstanding loans from that initial quantity.
 
Thanks you very much. If you have time could you please give me the example of coding?

Thanks,
 
In theory each book should have an ISBN so if you have say 5 copies of the same book you would have the same ISBN repeated 5 times in your table. This sounds denormalised, however, each copy will have its own unique copy number, so by compounding the ISBN to the copy number you make it unique.

When the borrower takes out a book you can identify which copy of the book has been taken. If you have an in/out flag as field in your table for each copy you simply need to sum the in/out field to caclulate how namy are in or out.

David
 

Users who are viewing this thread

Back
Top Bottom