© 2007 The Smart Method Ltd
85
Session 4: Exercise
1
Create a new blank database named Exercise 4.
2
Create a new form and save it with the name frmTest.
3
Add a command button to the form and set its Caption property to Log In with the first letter (L)
as the hotkey.
4
Because the command button has the caption Log In there can only be one possible name for the
control in order to observe the Cradle to the Grave Naming Convention. Set the Name property of
the command button to the appropriate value.
When you have finished check that you have correctly set the name and caption of the command
button by sliding the page slightly to the left to view the Q4 answer.
5
Go to the event handler for the command button’s Click event. Create two variables there called
strLogInName and strLogInPassword containing the following data:
strLogInName David Bowie
strPassword HunkyDory
6
Add code to the event handler that will put the following dialog on screen by concatenating the
text within the two variables.
Only if you are unable to do this check the code listing by sliding the page to the left and viewing the
Q6 answer.
7
Set a breakpoint at the Call MsgBox… line in your code. Execute your code by clicking the
cmdLogIn button.
8
Use the Immediate window to change the strName value from David Bowie to Mick Jagger.
9
Continue code execution and observe the new message that is displayed.
If you had any difficulty with this, slide the page to the left for instructions upon how to progress in
the Q9 answer.
Exercise4End