Verifying a Date from previous record before allowing new record a

D

Devon

Hello

I am creating a database to keep track of books being checked out. I have
two tables (books, and users). I have a Main Form to keep track of the
books, and and Subform to keep track of the users. All seems to be working
correctly, but I do need some assistance.

How do I code for the following: If Book #1 is checked out by John Smith, I
want to make sure nobody else can check out the book without a
Date_Checked_In field being populated for John Smith.

I am thinking I would need to create an If/Then statement using Before
Update on the first field in the Subform to check for the Date_Checked_In
field of the previous record, but am not sure what the fields would be called
within Access.

Please let me know if you have any questions.

Thanks

Devon
 
J

Jeff Boyce

Devon

It all starts with the data...

If you (only) have two tables, you may need to rethink your data design.

I'm basing the following on my guesses about a "books-checked-out"
situation.

Yes, you need a table of users.

Yes, you need a table of books.

But you also need (I suspect) a table of "books-checked-out", with fields
something like:

trelBooksCheckedOut
BooksCheckedOutID
BookID
UserID
CheckoutDate
CheckinDate


Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

Devon

Jeff

Sorry for the delayed response. I have been away from my computer.

Yes, I agree with you that an additional table is needed. I will work on
that.

Devon
 

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

Top