frmPropertyAdd is a columnar form, bound to tblPropertyForRent. A tab control is used to separate details of the property itself, administrative details (the branch it is registered at, its managing staff member and its owner), and a picture of the property.
Entity integrity, referential integrity and required data constraints are enforced in the design of tblPropertyForRent, and combo boxes are used for BranchNo, StaffNo, PrivateOwnerNo and BusinessOwnerNo, to facilitate selection of the correct value. The combo boxes for branch and staff are linked so that only staff members at the selected branch are displayed. A combo box based on a lookup table, tlkpPropertyType, is used so that the full name rather than just the code of the property type can be displayed.
The enterprise constraint that a staff member may not manage more than 10 properties is enforced using hidden text boxes on the form and a macro to test the condition and display an error message if necessary.
If the property owner’s details are not already on file, they can be added by calling frmOwnerBusiness or frmOwnerPrivate from the form. After the owner details are entered the owner form is closed and the user returns to frmPropertyAdd to complete the property record. The constraint that a property may have only one owner, either business or private, is enforced in the design of tblPropertyForRent.
Command buttons are used to save the property record and close the form. The record (except for the picture) is also written to tblPropertyForRentLog. A New Property command button enables the user to move to a new record without first returning to the switchboard, facilitating entry of several records at one time. A command button is added to the ‘Picture’ tab to help the user insert a picture.