December 15, 200124 yr Our office has a Catalog DB that has lists of books and videos. When someone borrows an item the DB goes to a Reservation DB (which is also related to a Name/Address DB). Right now, the only way to prevent double booking is to notice the portal in both the Catalog DB and the Reservation DB that lists all the reservations by date. I'm looking for more error control. Is there any way to make it where the Date Out field in the Reservation DB would catch the double booking if I tried to type in a date that was in the range in which that particular item was already reserved for another borrower?
December 17, 200124 yr When you enter a new reservation you will need to check it against all other reservation records with a looping script. Assuming your new reservation date out and date in are stored in temporary global fields gDout and gDin, and the existing reservations are in normal date fields Dout and Din, and your Books/videos have a unique identifier "ItemNumber" and a temporary global holding the current item that you are booking the reservation on "gTempItemNumber", you would have a script something like this in your reservations file: code: Set Error Capture [On] #Find all reservation records for the item Enter Find Mode [no restore] Set Field [itemNumber, gtempItemNumber] Perform Find [no restore] If [status(CurrentFoundCount)<>0] #At least one reservation record has been found, so check dates. Go to Record/Request [First] Loop If [ not (gDout>Din or Dout>gDin)] Show Message ["There is a conflicting reservation"] Halt Script End If Go to Record/Request[next][exit after last] End Loop End If Show Message ["There are no conflicting reservations"] [ December 17, 2001: Message edited by: BobWeaver ]
Create an account or sign in to comment