Re: Updating form using Query



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


"Sarah" <Sarah@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4B658646-43E3-4FDD-894C-F4CD98E3BA27@xxxxxxxxxxxxxxxx
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.
--
Sarah



.



Relevant Pages

  • Codes for Checking Rooms Availability
    ... I have a form with, among others, controls for RoomNo., CheckInDate and ... for the period as stated in CheckInDate and CheckOutDate. ... the codes seem to run alright. ...
    (comp.databases.ms-access)
  • Re: Codes for Checking Rooms Availability
    ... for the period as stated in CheckInDate and CheckOutDate. ... I have used the OpenRecordSet method for the AfterUpdate event in the ... "tblRooms" the codes seem to run alright. ...
    (comp.databases.ms-access)
  • Re: How do you calculate a null date?
    ... It isn't clear what you want for the calculation if the CheckOutDate is ... Nights: Nz) - CheckInDate ... Duane Hookom ...
    (microsoft.public.access.queries)