Whoo hoo! I think I've got it working! I have two queries: Qry_All, which is
the mother of all queries in my app, and Qry_Transaction, which shows books
which are on loan. Basically, I realized that I was being boneheaded
(really!) <g>. All I had to do was add Qry_Transaction to Qry_All, and do an
IIF on TimeOut. If it was null, then book wasn't on loan, if not null, it
was in circulation. This seems to work, and the form shows no lag for
calculation in the control.
Dirk, this may be what your suggested query would have done.. I haven't
looked at it closely. (I really wanted to try and solve it myself if I
could...)
Also, I can try, tomorrow, to simply incorporate the sql from
Qry_Transaction into Qry_All, as you suggested might be possible..
Of course, I need to do some testing tomorrow, but, yippee! I think I got
it!
Thanks!
Fred
Tables:
Tbl_Library: Book_ID, Title, Dewey, Copy#, MediaFormat_ID, etc.
Tbl_Author: Author_ID, AuthorLastName, etc.
Tbl_BookAuthor: Book_ID, Author_ID
Tbl_Subject: Subject_ID, SubjectHeading, etc.
Tbl_BookSubject: BookID, Subject_ID
Tbl_Series: Series_ID, Series
Tbl_MediaFormat: MediaFormat_ID, Format
etc...
Tbl_Transaction: Book_ID, TimeOut, TimeIn, Patron_ID
Tbl_Patrons: Patron_ID, Lastname, etc.
SELECT Tbl_Library.*, Tbl_Author.AuthorFirstName,
Tbl_Author.AuthorMiddleName, Tbl_Author.AuthorLastName,
Tbl_Location.Location, Tbl_Status.Status, Tbl_PubPlace.PubPlace,
Tbl_Binding.Binding, Tbl_MediaFormat.MediaFormat, Tbl_Publisher.Publisher,
Tbl_Series.Series, [Tbl_Author].[AuthorLastName] & (",
"+[Tbl_Author].[AuthorFirstName]) & " " & [Tbl_Author].[AuthorMiddleName] AS
Author, Tbl_Subject.Subject, nz([NumberofCassettes],"N/A") AS [#cass],
Qry_Transaction.TimeIn, IIf(IsNull([TimeOut]),"YES","No") AS Available
FROM Tbl_Subject RIGHT JOIN (Tbl_Status INNER JOIN (Tbl_PubPlace INNER JOIN
(Tbl_Publisher INNER JOIN (Tbl_MediaFormat INNER JOIN (Tbl_Location INNER
JOIN ((((Tbl_Binding INNER JOIN (Tbl_Library LEFT JOIN Qry_Transaction ON
Tbl_Library.Book_ID = Qry_Transaction.Book_ID) ON Tbl_Binding.Binding_ID =
Tbl_Library.Binding_ID) LEFT JOIN (Tbl_Author RIGHT JOIN Tbl_BookAuthor ON
Tbl_Author.Author_ID = Tbl_BookAuthor.Author_ID) ON Tbl_Library.Book_ID =
Tbl_BookAuthor.Book_ID) LEFT JOIN (Tbl_BookSeries LEFT JOIN Tbl_Series ON
Tbl_BookSeries.Series_ID = Tbl_Series.Series_ID) ON Tbl_Library.Book_ID =
Tbl_BookSeries.Book_ID) LEFT JOIN Tbl_BookSubject ON Tbl_Library.Book_ID =
Tbl_BookSubject.Book_ID) ON Tbl_Location.Location_ID =
Tbl_Library.Location_ID) ON Tbl_MediaFormat.MediaFormat_ID =
Tbl_Library.MediaFormat_ID) ON Tbl_Publisher.Publisher_ID =
Tbl_Library.Publisher_ID) ON Tbl_PubPlace.PubPlace_ID =
Tbl_Library.PubPlace_ID) ON Tbl_Status.Status_ID = Tbl_Library.Status_ID) ON
Tbl_Subject.Subject_ID = Tbl_BookSubject.Subject_ID
ORDER BY Tbl_Library.Book_ID;
SELECT Tbl_Transaction.*, Tbl_Library.Title, [Tbl_Patrons.LastName] & ", " &
[Tbl_Patrons.FirstName] AS Fullname
FROM Tbl_Patrons INNER JOIN (Tbl_Library INNER JOIN Tbl_Transaction ON
Tbl_Library.Book_ID = Tbl_Transaction.Book_ID) ON Tbl_Patrons.Patron_ID =
Tbl_Transaction.Patron_ID
WHERE (((Tbl_Transaction.TimeIn) Is Null))
ORDER BY Tbl_Transaction.Book_ID;