Chapter 3- Data Types and Operators Boolean Expressions Page 2 3 4

Introduction

The If Statement Page 2 3 4 5 6 7 8 9
Arithmetic Operations Page 2 3 4 5 6 Boolean Operators and Nested If Statements Page 2 3 4 5 6 7
Events and Sequential Processing Page 2 3 4 5 More Examples Page 2 3 4 5 6 7 8 9 10 11 12
Datatypes and Conversions Page 2 3 4 5 6 7 Using Check Box and Option Controls Page 2 3 4 5 6 7 8 9 10
Variable Declarations - Local and Global Page 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Exercises Page 2 3 4 5 6 7 8
Chapter 4- Selection Statements Review Questions
Introduction

3-5: Variable Declarations (continued)

The Clear Button

The final component of Exercise 3-3 is to program the action of the click event for the Clear button. Obviously one action is to assign the null string to the Text properties of the Year, Interest and Capital textboxes.

Equally clearly the Initial Capital and Interest Rate textboxes should be cleared. But should the null string be assigned to their Text properties? Try it! Write the click event for the Clear button as follows:

Private Sub btnClear_Click()
txtInitialCap.Text = vbNullString
txtRate.Text = vbNullString
txtYear.Text = vbNullString
txtInterest.Text = vbNullString
txtCapital.Text = vbNullString
End Sub

What is causing the error here? Can you fix it? This is left as an exercise for you.