Grabbing Single Item from Query

G

Guest

Hi I'm trying to get a library loan system working and have come across a
problem I cannot solve.

Before adding a loan the system should check the borrower to make sure that
they do not exceed their max loans. The max loans is stored in the borrower
table

I have a query calculates the total number of loans, and also gives a true
or false as to whether or not they can borrow another book.

I need to be able to grab this -1 or 0 value to the form before the new loan
is processed, I preferably don't want to see the query at all.

Any ideas on how to implement this or another way of doing it would be much
appreciated.
 
T

Tom Ellison

Dear AJ:

When a "borrower" (library patron?) comes to the counter with one or more
books to check out the borrower may also have in his hand one or more
returned books. Alternatively, he may have put the books into the "return
bin" a few minutes earlier. I won't just assume you will solve the
"physical difficulty" here, and that the returns will have been posted to
the computer when he checks out.

Now, there are still other difficulties. At the moment he steps up to the
counter you identify him and bring up his account. When the form opens, you
could query this and set to form according to whether he is allowed to
borrow another book. You will need a mechanism that says how many books he
my add. Perhaps the -1 or 0 is not sufficient. If he has permission to
borrow 2 more books, and brings 3, you would want to handle that, wouldn't
you?

Now, at the counter, he may not be allowed to borrow because the returned
books have not been posted. Is there a probablility you will find and check
in books he has just returned? If so, then the person at the computer may
direct the computer to account for the returned books. When returning to
the check-out screen, the quantity should be refreshed. The Got Focus event
is a good one for this.

What if the returned books are entered on another computer after you bring
up his record? Are there going to be other computers, now or later? You
may need to refresh the count of books allowed at intervals (use a timer)
and/or provide a Refresh button to do this manually.

Can two people use the same account, with a combined limit? If husband and
wife use one card, and both are at the check-out at different computers,
there is a nice locking challenge.

You've arrived at a point requiring a fair amount of sophisticated problem
solving, but it is a classic problem, not something unkown. Just how much
thinking you need before beginning a solution depends on how fancy this will
eventually need to be.

Tom Ellsion
 
G

Guest

Wow thats opened alot of ideas and problems that I had never contemplated.

Have now figured out the obvious that "Dlookup" works on queries as well as
tables so have got the short term check can be implemented but I think I best
look into atleast working out how to handle multiple books being borrowed at
once.

Many thanks for the useful info
 
T

Tom Ellison

Dear AJ:

I'm sorry to be the bearer of bad news. But, it's going to be a lot better
to consider these things ahead of time than to be surprised later.

It was my primary purpose to get you to start thinking about this in a broad
manner. It sounds like that may have succeeded.

Tom Ellison
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Excluding related records in a query 3
Left Join 2
CombineChildRecords with concatenated fields 3
Randomizer 1
Please Fix This Query 1
Parameter in Query not working correctly 7
Expressions 2
Creating expressions 4

Top