© 2007 The Smart Method Ltd
109
Session 5: Exercise
1
Which data type is appropriate to store the following information.
Purpose
A number used to store a person’s age. . Long Integer . Integer
. Double
Text that will contain an Employee’s last
name.
. Variant
. String
. Double
The unit price of items for sale.
. Double
. Long Integer . Currency
An Employee’s date of birth.
. Variant
. Date
. String
The average purchase price of an item to
six decimal places.
. Long integer . Currency
. Double
Whether a client is active or not.
. Integer
. Variant
. Boolean
If you are having difficulty choosing the correct data type complete as many as you are sure of and
then slide the page slightly to the left to view the Q1 help and answers.
2
Create a new blank database named Exercise5.
3
Create a new form called frmTest.
4
Add three text box controls to the form (this will also automatically add three label controls) and a
command button. Set the Caption property of the labels to First Name, Last Name and Full Name
and the Caption property of the command button to Calculate Full Name.
5
The Cradle to the Grave Naming Convention requires that the names of the captions will dictate
the name properties of the three Text Box form controls and Command Button control. Name
them correctly.
The correct names for the controls can be viewed by sliding the page to the left and viewing the Q5
answers.
6
Add code to the cmdCalculateFullName command button’s Click event. The code needs to take
the two values in the txtFirstName and txtLastName text boxes, concatenate them with a space
between, and then put the result into the txtFullName text box.
If you have difficulties coding the event handler slide the page to view the Q6 help.
7
Test your form.
Exercise5