To get possession of an apartment, a customer must come
to the office, fill out a form, check what apartments are available, and
wait. An employee would process the application, check the available
apartments, check the customer's needs, and assign an apartment if everything
is alright. This process can be referred to as registration.
To process a registration, we will need:
- The Registration Number: This is a unique number that identifies each
registration
- The Registration Date: This is the date the record was created
- The Employee Number: This represents the employee who created the
record
- The Tenant Code: This is the account number of the customer whose
registration was processed
- The Apartment Number: This information identifies the apartment that
is allocated to the customer
- The Rent Start Date: This information lets us know the first
day the tenant starts occupying the apartment. The payments typically
start at the end of the month of that date
Practical
Learning: Registering the Tenants
|
|
- On the Ribbon, click Create
- In the Queries section, click Query Design
- Click Close on the Add Table dialog box
- Right-click the middle of the window and click SQL Code
- Type the following:
CREATE TABLE Registrations
(
RegistrationID Counter(1001, 1) not null,
Constraint PK_Registrations Primary Key(RegistrationID)
);
- To execute the code, on the Ribbon, click the Run button
- In the Navigation Pane, right-click Registrations and click Design
View
- Add the following fields:
Field Name |
Data Type |
Field Size |
Format |
Caption |
RegistrationID |
AutoNumber |
|
|
Registration ID |
RegistrationDate |
Date/Time |
|
Long Date |
Registration Date |
EmployeeNumber |
Text |
20 |
|
Employee Number |
TenantCode |
Text |
20 |
|
Tenant Code |
UnitNumber |
Text |
10 |
|
Unit Allocated |
RentStartDate |
Date/Time |
|
|
Rent Start Date |
Notes |
Memo |
|
|
|
- Close the table
- When asked whether you want to save, click Yes
- On the Ribbon, click Create and, in the Forms section, click Form
Design
- Save the form as Registrations
- Using the Properties window, set its Record Source as Registrations
- Design the form as follows (only the text boxes that are unbound are
listed):
|
Control |
Name |
Control Source |
Text Box |
|
txtEmployeeName |
=IIf(IsNull([EmployeeNumber]),"",DLookUp("LastName","Employees","EmployeeNumber
= '" & [EmployeeNumber] & "'") & ", " &
DLookUp("FirstName","Employees","EmployeeNumber = '" &
[EmployeeNumber] & "'")) |
Text Box |
|
txtTenantName |
=IIf(IsNull([TenantCode]),"",DLookUp("LastName","Tenants","TenantCode
= '" & [TenantCode] & "'") & ", " &
DLookUp("FirstName","Tenants","TenantCode = '" &
[TenantCode] & "'")) |
Text Box |
|
txtUnitDescription |
=IIf(IsNull([UnitNumber]),"",DLookUp("Bedrooms","Apartments","UnitNumber
= '" & [UnitNumber] & "'") & " beds, " &
DLookUp("Bathrooms","Apartments","UnitNumber = '" &
[UnitNumber] & "'") & " baths, rent = " &
FormatCurrency(DLookUp("MonthlyPrice","Apartments","UnitNumber
= '" & [UnitNumber] & "'"))) |
|
- Save and close the form
- In the Navigation Pane, double-click the Registrations form
- Create the following records:
Registration Date |
Empl # |
Tenant Code |
Unit # |
Rent Start Date |
Tuesday, June 12, 2012 |
38047 |
928411 |
109 |
01-Jul-12 |
Friday, June 15, 2012 |
92748 |
279475 |
104 |
01-Aug-12 |
Friday, June 22, 2012 |
27495 |
920074 |
103 |
01-Jul-12 |
Friday, June 22, 2012 |
94008 |
804085 |
305 |
01-Aug-12 |
Monday, July 23, 2012 |
94008 |
920948 |
105 |
01-Sep-12 |
Wednesday, July 25, 2012 |
27495 |
603848 |
106 |
01-Aug-12 |
Wednesday, August 01, 2012 |
38047 |
824922 |
204 |
01-Oct-12 |
Friday, August 10, 2012 |
27495 |
300409 |
108 |
01-Sep-12 |
Wednesday, September 12, 2012 |
92749 |
248506 |
209 |
01-Nov-12 |
Friday, October 05, 2012 |
38047 |
208081 |
202 |
01-Nov-12 |
- Close the Registrations form
At the end of each month, every tenant must pay rent. To
process a payment, we will need:
- The Payment Number: This is a uniqque number that identifies a
payment
- The Payment Date: This is the date the payment is/was made
- The Employee Number: This information identifies the employee who
processed or received the payment
- The Registration Number: In some applications, you may want to
identify a payment by the aparment number or the tenant. Experience
shows that a payment may be made by a person who is not living in the
apartment (a parent, a friend, a spouse, an employer, an acquaintance,
etc). A payment can also be made by two people, each paying part of the
rent. There are many other disparate possibilities like that. Therefore,
we will use the registration for which the payment is made. After all, a
registration number holds the apartment number and the tenant who is
occupying that apartment
- The Amount Paid: As you may know already, there are various types of
payments (such as security deposits, regular monthly payments, etc) and
various amounts of payments (remember that apartments have different prices)
Practical
Learning: Getting the Payments
|
|
- Access the Query Builder and change its code as follows:
CREATE TABLE Payments
(
ReceiptNumber Counter(100001, 1) not null,
Constraint PK_Payments Primary Key(ReceiptNumber)
)
- To execute the code, on the Ribbon, click the Run button
- Close the Query Builder
- When asked whether you want to save, click No
- In the Navigation Pane, right-click Payments and click Design View
- Add the following fields:
Field Name |
Data Type |
Field Size |
Format |
Caption |
ReceiptNumber |
AutoNumber |
|
|
Receipt Number |
PaymentDate |
Date/Time |
|
Long Date |
Payment Date |
EmployeeNumber |
Text |
20 |
|
Processed By |
RegistrationID |
Number |
Long Integer |
|
|
AmountPaid |
Number |
Double |
Fixed |
Amount |
Notes |
Memo |
|
|
|
- Close the table
- When asked whether you want to save, click Yes
- On the Ribbon, click Create and, in the Forms section, click Form
Design
- Save the form as Payments
- Using the Properties window, set its Record Source as Payments
- Design the form as follows (only the text boxes that are unbound are
listed):
|
Control |
Name |
Control Source |
Visible |
Text Box |
|
txtTenantCode |
=IIf(IsNull([RegistrationID]), "",
DLookUp("TenantCode", "Registrations", "RegistrationID =
" & [RegistrationID])) |
No |
Text Box |
|
txtUnitNumber |
=IIf(IsNull([RegistrationID]), "",
DLookUp("UnitNumber", "Registrations", "RegistrationID =
" & [RegistrationID])) |
No |
Text Box |
|
txtEmployeeName |
=IIf(IsNull([EmployeeNumber]), "",
DLookUp("LastName", "Employees", "EmployeeNumber = '" &
[EmployeeNumber] & "'") & ", " & DLookUp("FirstName",
"Employees", "EmployeeNumber = '" & [EmployeeNumber] &
"'")) |
|
Text Box |
|
txtRegistration |
=IIf(IsNull([RegistrationID]), "", "Tenant: " &
DLookUp("LastName", "Tenants", "TenantCode = '" &
[txtTenantCode] & "'") & ", " & DLookUp("FirstName",
"Tenants", "TenantCode = '" & [txtTenantCode] & "'") &
Chr(13) & Chr(10) & "Unit Occupied: " &
DLookUp("UnitNumber", "Registrations", "RegistrationID =
" & [RegistrationID]) & Chr(13) & Chr(10) & "Monthly
Payment: " & FormatCurrency(DLookUp("MonthlyPrice",
"Apartments", "UnitNumber = '" & [txtUnitNumber] &
"'"))) |
|
|
- Save and close the form
- In the Navigation Pane, double-click the Payments form
- Create the following records:
Payment Date |
Empl # |
Reg ID |
Amount |
Notes |
Friday, June 22, 2012 |
38047 |
1001 |
450 |
This is the payment for the security deposit. |
Monday, June 25, 2012 |
92749 |
1002 |
500 |
Payment for security deposit |
Monday, July 02, 2012 |
27495 |
1003 |
350 |
Security Deposit |
Wednesday, July 25, 2012 |
38047 |
1001 |
1150 |
|
Thursday, July 26, 2012 |
94008 |
1003 |
925 |
|
Wednesday, August 01, 2012 |
27495 |
1006 |
500 |
Security Deposit |
Wednesday, August 08, 2012 |
27495 |
1008 |
300 |
Security Deposit |
Wednesday, August 08, 2012 |
27495 |
1007 |
500 |
Security Deposit |
Monday, August 13, 2012 |
27495 |
1004 |
400 |
Security Deposit |
Monday, August 27, 2012 |
27495 |
1004 |
1100 |
|
Tuesday, August 28, 2012 |
92749 |
1002 |
1350 |
|
Tuesday, August 28, 2012 |
38047 |
1001 |
1150 |
|
Thursday, August 30, 2012 |
94008 |
1003 |
925 |
|
Thursday, August 30, 2012 |
94008 |
1006 |
1350 |
|
Monday, September 17, 2012 |
27495 |
1009 |
450 |
Security Deposit |
Tuesday, September 18, 2012 |
92749 |
1005 |
400 |
Security Deposit |
Tuesday, September 25, 2012 |
92749 |
1004 |
1100 |
|
Tuesday, September 25, 2012 |
92749 |
1008 |
885 |
|
Tuesday, September 25, 2012 |
92749 |
1006 |
1350 |
|
Thursday, September 27, 2012 |
92749 |
1001 |
1150 |
|
Friday, September 28, 2012 |
27495 |
1002 |
1350 |
|
Friday, September 28, 2012 |
27495 |
1005 |
1150 |
|
Monday, October 01, 2012 |
38047 |
1003 |
925 |
|
Monday, October 08, 2012 |
27495 |
1010 |
300 |
Security Deposit |
Wednesday, October 24, 2012 |
92749 |
1004 |
1100 |
|
Wednesday, October 24, 2012 |
92749 |
1005 |
1150 |
|
Thursday, October 25, 2012 |
27495 |
1006 |
1350 |
|
Thursday, October 25, 2012 |
27495 |
1007 |
1250 |
|
Friday, October 26, 2012 |
92749 |
1002 |
1350 |
|
Monday, October 29, 2012 |
62797 |
1001 |
1150 |
|
Monday, October 29, 2012 |
62797 |
1008 |
885 |
|
Tuesday, October 30, 2012 |
27495 |
1003 |
925 |
|
Monday, November 26, 2012 |
92749 |
1008 |
885 |
|
Monday, November 26, 2012 |
38047 |
1002 |
1350 |
|
Tuesday, November 27, 2012 |
38047 |
1006 |
1350 |
|
Wednesday, November 28, 2012 |
62797 |
1001 |
1150 |
|
Wednesday, November 28, 2012 |
94008 |
1004 |
1100 |
|
Wednesday, November 28, 2012 |
92749 |
1005 |
1150 |
|
Wednesday, November 28, 2012 |
92749 |
1007 |
1250 |
|
Friday, November 30, 2012 |
94008 |
1009 |
1150 |
|
Friday, November 30, 2012 |
38047 |
1003 |
925 |
|
Friday, November 30, 2012 |
92748 |
1010 |
895 |
|
Sunday, December 02, 2012 |
92749 |
1002 |
1350 |
|
Tuesday, December 25, 2012 |
38047 |
1006 |
1350 |
|
Tuesday, December 25, 2012 |
38047 |
1007 |
1250 |
|
Wednesday, December 26, 2012 |
62797 |
1002 |
1350 |
|
Wednesday, December 26, 2012 |
94008 |
1001 |
1150 |
|
Thursday, December 27, 2012 |
92748 |
1009 |
1150 |
|
Friday, December 28, 2012 |
38047 |
1005 |
1150 |
|
Friday, December 28, 2012 |
94008 |
1010 |
895 |
|
Friday, December 28, 2012 |
92749 |
1004 |
1100 |
|
Friday, December 28, 2012 |
94008 |
1003 |
925 |
|
Monday, December 31, 2012 |
92749 |
1008 |
885 |
|
- Close the Registrations form
Summary of Customer Payments
|
|
A summary of customer payments is a document that shows
a list of payments the customer has made. It also shows information such as
the date a payment was made.
Practical
Learning: Creating the Summary
|
|
- On the Ribbon, click Create and, in the Forms section, click Form
Design
- Save the form as sfPayments
- Using the Properties window, change the following characteristics:
Record Source: Payments Default View: Continuous Forms Navigation
Buttons: No
- Design the form as follows (only the text boxes that are unbound are
listed):
|
Control |
Name |
Caption |
Control Source |
Label |
|
|
Receipt # |
|
Label |
|
|
Payment Date |
|
Label |
|
|
Processed By |
|
Label |
|
|
Amount |
|
Text Box |
|
ReceiptNumber |
|
ReceiptNumber |
Text Box |
|
PaymentDate |
|
PaymentDate |
Text Box |
|
EmployeeNumber |
|
EmployeeNumber |
Text Box |
|
txtEmployeeName |
|
=IIf(IsNull([EmployeeNumber]),"",DLookUp("EmployeeName","Employees","EmployeeNumber
= '" & [EmployeeNumber] & "'")) |
Text Box |
|
AmountPaid |
|
AmountPaid |
|
- Save and close the form
- On the Ribbon, click Create and, in the Forms section, click Form
Design
- Save the form as TenantsAccountsSummaries
- Using the Properties window, set the record source to SELECT
Tenants.TenantCode, Tenants.TenantName,
IIf(CByte([NumberOfChildren])=1,[MaritalStatus] & ', one
child',[MaritalStatus] & ', ' & [NumberOfChildren] & ' children') AS
Details, Registrations.RegistrationID, Registrations.UnitNumber,
Registrations.RentStartDate FROM Tenants INNER JOIN Registrations ON
Tenants.TenantCode=Registrations.TenantCode;
- Design the form as follows (only the text boxes that are unbound are
listed):
|
Control |
Name |
Caption |
Control Source |
Other Properties |
Text Box |
|
TenantCode |
Tenant Code: |
TenantCode |
|
Text Box |
|
RentStartDate |
Tenant Since: |
RentStartDate |
|
Text Box |
|
TenantName |
Tenant Name: |
TenantName |
|
Text Box |
|
UnitNumber |
|
=IIf(IsNull([EmployeeNumber]), "",
DLookUp("EmployeeName", "Employees", "EmployeeNumber =
'" & [EmployeeNumber] & "'")) |
|
Text Box |
|
AmountPaid |
Aprt Occupied: |
AmountPaid |
|
Text Box |
|
Details |
Details: |
Details |
|
Subform / subreport |
|
sfPayments |
Payments |
|
Source Object: sfPayments Link Master Fields:
RegistrationID Link Child Fields: RegistrationID |
|
- Save and close the form
|
|