Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004
    Posts
    11

    Unanswered: Limiting number of items a customer can have?

    Hi,

    How do I apply a limit to my library database to stop borrowers having anymore than say 7 books at the one time? New loans are recorded via a Loans form which contains a subform allowing the librarian to add new items to the Loan.

    I need to make sure that no matter how many Loans take place, the number of items loaned to any borrower over 1 loan or more cannot be more than 7 at the same time.

    Initially I had though a Count function would solve this but I'm unsure right now. Any help is appreciated.

    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    You can do this 2 ways: Either have a running count of loaned books OR have a count of the books available to be loaned to the user ... The latter is much easier to implement.
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    The former isn't very difficult either..

    A simple DCount() check before executing your checkout procedure would be sufficient.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Nov 2004
    Posts
    11
    Quote Originally Posted by M Owen
    You can do this 2 ways: Either have a running count of loaned books OR have a count of the books available to be loaned to the user ... The latter is much easier to implement.
    Thanks for your replies. At present I have an ItemLimit Table that stores an item limit for adults and children. Adults are allowed 7 books at one time and children only 5.

    On the loan form where the loans are authorised, the borrowers itemlimit is looked up from this table and as such there is a box that displays the upper limit of loans for that person.

    What kind of code would I need to implement your suggestion? NOTE: There is a subform which displays a loan details junction table storing details of all items currently on loan. This subform is the primary method of adding a book to the loan list. So I really need to work a solution through that subform where if the items loaned to a given borrower ID is greater than the limit for that ID it has to prevent the transaction.

    I know its complex but i really would appreciate any help you guys could offer.

    Many thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •