frmLeaseAgreement is an unbound form and uses an action query to create a new lease record. Combo boxes are used to help the user enter correct information. The combo box for RenterNo lists all renters registered at DreamHome, since it is possible that they may rent more than one property at a time. The combo for PropertyNo lists all properties that are available for rent, i.e. they are not withdrawn and not currently leased. When the property is selected, an expression in the MonthlyRent control looks up the rent for the property and an expression in the Deposit control calculates the deposit amount as twice the rental. The payment method is selected from a combo box displaying a list of valid payment methods.
The user may choose to enter the start date only and select from a three, six or twelve months lease duration, rather than entering both the start and end date. The end date is then calculated. Error messages are displayed if the user enters a date before today, or if they enter a lease duration that is less than three or more than twelve months.
When all the data has been entered, the user clicks the Create Lease Agreement button to create the new lease record. A check is first made that all required data has been entered, and an error raised if not. If the data is correct, an append query runs that enters a new record into tblLeaseAgreement using the information on the form. The Print Lease Agreement command button is then enabled. Clicking the Print Lease button prints rptLeaseAgreement, the lease document.