Hi Sharon, I don't see any attachment above? I knocked up a simple but complete app for you i the attached.
I will edit this post and discuss coding asap but as you seemed to be in a hurry posted the app.
========= explanation =========
Seemed to me that the room types should be stored in a table so allowing adding removing, modifying differing room types/grades without getting into any code blocks
The report screen form contains a combo box bound to the roomtype table. There are two more unbound text boxes to hold start and end dates for the report period. The easiest way to handle entering the date was to place a calendar control on the form and a setdate button for both the start date(btnstartdate) and end date (btnenddate) of the report
-
the onclick event for btnstartdate:
-
startdate.value=calendar1.value
-
the onclick event for btnenddate:
-
enddate.value=calendar1.value
-
selecting report options sets hidden textbox reptype to a value of either avguseroomtype (average use for room type specified only)or avguseall (include all room types in report)
Selecting to preview the report calls a first query which uses the results of a second query.
The first query takes the values roomtype, startdate, enddate from the unbound fields on the form and places them in the criteria field of the query,then looks up the corresponding values in table roomdata
Forms!reports.controls!roomtype.value
>=Forms!reports.controls!startdate.value
<=Forms!reports.controls!enddate.value
The query also contains an expression field to calculate the days between the start and end dates.
DateDiff("d",startdate,enddate)
The second query simply takes the output days from query number one and calculates an average.
The report calls query two then sums and formats the data for presentation.
The query used for all room types is the same as the first except that the criteria box for room type is left blank.