HandsOn Continued

1. Position the insertion point anywhere within the CostOfPurch procedure and press F5.

2. When the dialog box appears, enter a number. For example, type 100 and press Enter. Visual Basic displays the message "The cost of a new purchase is: 100."

3. Click OK in the message box. Visual Basic displays the second message "The running cost is: 100."

4. Rerun the same procedure.

5. When the input box dialog appears, enter another number. For example, type 50 and press Enter. Visual Basic displays the message "The cost of a new purchase is 50."

6. Click OK in the message box. Visual Basic displays the second message "The running cost is: 150."

7. Run the procedure a couple of times to see how Visual Basic keeps track of the running total.

Introduction to Access 2003 VBA Programming

0 0

Post a comment