Jump to content

This topic is 8448 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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 ]

This topic is 8448 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.