Iknow this is probably extremely simple but I cannot make any progress so any help will be very gratefully received.
I have two tables, tblallocations and tblReservation.
In tblallocations are the following fields:
allocateDate (a datetime field)
roomassignid (an integer)
quantity (integer) with a starting value which varies from record to record
available (calculation) which subtracts the number of rooms booked from the quantity to see how many are still available. This all works fine.
In the second table, tblReservation are the following fields:
locationID (global number field) - selected from a value list
roomcatid (glbal number field) selected from a value list of related values to locationID.
sel_roomassignID (calculated based on the two abovefields being entered)
tmpindate( a global datetime field)
tmpOutDate (a global datetime field)
tmpRoomCount (a global integer field)
After entering values in tblReservation, a method runs and correctly creates all the reservation records.
What I am trying (and failing - miserably) to do is run a check to make sure that the number of rooms required for the dates in question, (less the last day since that is checkout) for that particular roomassignID is <= to (available+tmpRoomCount).
If there are sufficient rooms available, then the reservation will continue, other wise it will bring up a dialog saying that there are no rooms available for one or more dates.
Many thanks.