I have a database where the Rate information is coded into a Select Case (see below) and I want to modify the database to store the rate information in a table to facilitate changing the rates.
I have a frmCheck-In where the operator enters a room number. There is a tblRoom whose fields are RumberNumber and RoomTypeID. There is also a new tblRoomType whose fields are RoomTypeID, RoomType, WeeklyRate, MonthlyRate, DailyRate, and BusinessRate.
Question 1: Once the Room Number is entered, how can the RoomType be displayed?
The operator then selects the Pay Code (see below) from a drop down list and enters either 1 or 2 in the Occupants field (new field).
Question 2: How can the Room Rate to be displayed and stored in the RoomRate field in tblRental.
Examples of the various combinations for 1 room type:
If [RoomTypeID]=1 and [PayCodeID] =1 and [Occupants]=1 then[RoomRate]=[WeeklyRate]
If [RoomTypeID]=1 and [PayCodeID] =1 and [Occupants]=2 then [RoomRate]=[WeeklyRate]+20
If [RoomTypeID]=1 and [PayCodeID] =2 and [Occupants]=1 then [RoomRate]=[MonthlyRate]
If [RoomTypeID]=1 and [PayCodeID] =2 and [Occupants]=2 then [RoomRate]=[MonthlyRate]+60
If [RoomTypeID] =1 and [PayCodeID =3 and [Occupants]=1 then
[RoomRate]=[Daily]
If [RoomTypeID] =1 and [PayCodeID =3 and [Occupants]=2 then
[RoomRate]=[Daily]+5
If [RoomTypeID] =1 and [PayCodeID =5 and [Occupants]=1 then
[RoomRate]=[Business]
If [RoomTypeID] =1 and [PayCodeID =5 and [Occupants]=2 then
[RoomRate]=[Business]+10
PayCodeID 4 is Non-Room so If [RoomTypeID]=4 then [RoomRate]=0 regardless of the RoomType.
There are 7 Room Types and 5 Pay Codes so the If statements would contain all the various combinations of Room Types, Pay Codes and Number of Occupants.
Room Types are Standard, Mini, Double, Standard King, Executive, Jr. Executive and Handicap
Pay Codes are Weekly, Monthly, Daily, Non-Room and Business
The existing Select Case is attached as a word file
The operator has the ability to over ride the standard or rack rate. The room rate and rack rate are both saved so we can produce a report to show when the manager has charged something different from the rack rate.
The Business rate is available for only certain type of rooms so the manager get an error message if a business rate is entered for a room that in not entitled to the business rate.
Any assistance would be greatly appreciated.
Tom



