Robbyp2001
Registered User.
- Local time
- Tomorrow, 01:39
- Joined
- Oct 8, 2011
- Messages
- 143
Hello folks, I have a question for the boffins on here. I have a school library system set up and one of its functions is to record each student's library activity (for awards at the end of the year). The function works well, however I've thought of a scenario which could well occur at some point. If the librarian checks out a book and mistakenly adds the wrong student name, the details will be logged in a table called [BookStudentTbl]. He or she can then rectify this error by changing the student name on the main form. However when applying the correct name, both records now appear in [BookStudentTbl]. One of these records (the earlier one) is of course, wrong. My question is: How can I automatically get the system to check for this error and delete the erroneous record?
My thoughts are: somehow check for the same book (bookID), issued twice on the same day and delete the first of these, as this will be the erroneous one. The BSID autonumber will show which of these was created first, but how do I delete this? Am I approaching this in the wrong way?
Any advice will be gratefully received as I am stumped by this!
[BookStudentTbl] has the following fields
BSID AutoNumber
StudentID Number (keyfield) Unique
BookID Number (keyfield) Unique
DateOut Date/Time (keyfield)
DateIn Date/Time
Time Date/Time
TimeIn Date/Time
Note: The combination of key fields is to reject a record where a student may borrow a book, return it on the same day and borrow it again, thus recording two books borrowed instead of one.
My thoughts are: somehow check for the same book (bookID), issued twice on the same day and delete the first of these, as this will be the erroneous one. The BSID autonumber will show which of these was created first, but how do I delete this? Am I approaching this in the wrong way?
Any advice will be gratefully received as I am stumped by this!
[BookStudentTbl] has the following fields
BSID AutoNumber
StudentID Number (keyfield) Unique
BookID Number (keyfield) Unique
DateOut Date/Time (keyfield)
DateIn Date/Time
Time Date/Time
TimeIn Date/Time
Note: The combination of key fields is to reject a record where a student may borrow a book, return it on the same day and borrow it again, thus recording two books borrowed instead of one.