19.12.2012 Views

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

Computer Programming Concepts and Visual Basic David I. Schneider

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

to the SetupCheck Sub procedure, which is normally used to switch from deposit entry to<br />

check entry, but also can be called by the Form_Load event procedure to prepare the initial<br />

mode (check or deposit) for the form.<br />

TABLE 7.1<br />

Objects <strong>and</strong> Initial Properties for the Checkbook Management Program<br />

Object Property Setting<br />

frmCheckbook<br />

picBox<br />

lblName BackStyle 0 – Transparent<br />

txtNum BorderStyle 0 – None<br />

lblDate BackStyle 0 – Transparent<br />

Caption Date<br />

txtDate<br />

lblToFrom BackStyle 0 – Transparent<br />

txtToFrom<br />

lblAmount BackStyle 0 – Transparent<br />

Caption Amount $<br />

txtAmount<br />

lblMemo BackStyle 0 – Transparent<br />

Caption Memo<br />

txtMemo<br />

lblCurBal Caption Current Balance<br />

lblBalance<br />

cmdRecord<br />

cmdMode<br />

cmdPrint Caption &Print Report<br />

cmdQuit Caption &Quit<br />

The transactions are stored in a data file named CHKBOOK.TXT. The first four entries<br />

of the file are the name to appear on the check or deposit slip, the starting balance, the number<br />

of the first check, <strong>and</strong> the number of the first deposit slip. After that, each transaction is<br />

recorded as a sequence of eight items—the type of transaction, the contents of txtToFrom,<br />

the current balance, the number of the last check, the number of the last deposit slip, the<br />

amount of money, the memo, <strong>and</strong> the date.<br />

■ CODING THE PROGRAM<br />

A Case Study: Recording Checks <strong>and</strong> Deposits 231<br />

The top row of Figure 7-8 shows the different events to which the program must respond.<br />

Table 7.2 identifies the corresponding event procedures <strong>and</strong> the general procedures they call.<br />

FIGURE 7-8 Hierarchy Chart for Checkbook Management Program

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!