Updating form using Query

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

Guest

I am not sure if this is the correct place to put this question. I am
creating a library application. When someone checks out a book, I want to
check the database first to see if that book is in or out. I have the book
num as a text box and the in/out is in a table. Is there any way to have a
query return something in the VBA so that I can do a if ... then clause. I
normally run queries using DoCmd.openquery but it won't work in this case.
Thanks.
 
Hi,


SELECT bookID, CheckOutDate, CheckInDate
FROM checks
WHERE bookID=[ which book you look for:]
AND CheckOutDate = (SELECT MAX(CheckOutDate)
FROM checks
WHERE bookID=[ which book you look
for:] )




and if CheckInDate is NULL, that means the book has not been returned (or
returned and not entered in the db).


Hoping it may help,
Vanderghast, Access MVP
 

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


Back
Top