The form design

We need to create a form to provide the user with a means of entering the rep name and the rep sales to date. The form design is shown in Figure 10.7. The form Caption property has been called 'Add a Rep'. Two text boxes have been created: one for the new rep name, the other for the sales. Labels for the two buttons and other controls are also included. A Frameset has b een added to surround the related items: rep name and sales, and its caption is 'Enter Details'. There is also a list box, which is used to display the existing rep names. There are two buttons: one to add details to the worksheet, and one to cancel the action.

Three event handlers are required to implement this task:

♦ One for the AddDetails button on the form;

♦ One for the Cancel button on the form;

♦ One for the Initialize procedure. There is no button for this because its called automatically when the form is first opened.

| Microsoft Visual Basic - salesman interface v3.xls - [salesman interface v3.xls - UserForml (UserForm)]

File Edit View Insert Format Debug Run Tools Add-Ins Window Help m ii • isi k ia e ^ "T > ir ■jp I'dfc ^gg ||

jnjxj

Project - VBAProject iE

SffiBWB

BorderColor BorderStyle Caption Cycle

D raw E utter-

Enabled

Font

ForeColor Height

HelpContextlD

KeepScrollBarsVis

Lett

Mouselcon '.■lousePointsi-

Picture_

PictureAlignment "ictuf ebiseMcde

0 - fmCydeAllFc 32000

True_

Tahoma

3 - fmScrollBars

Starting Sales

Figure 10.7 Design of the Add Rep form to SALESMAN Workbook.

Microsoft Visual Basic - SALESMAN INTERFACE.hIs - [SALESMAN INTERFACE.hIs - UserForml (UserForm)]

File Edit View Insert Format Debug Run Tools Add-Ins Window Help ilgliaMHl « > I, . M, i# #

Project - VBAPruject Q

Properties Frame 1 |

Frame 1 Frame Alphabetic Categi

(Name) Frame 1 j BackColor □ &H80C~ EiorderColoiB &H80C Border5tyle 0 - fmBort Enter Del

ControlTlpT_

Enabled True

Font__Tahoma j

HelpConte:>: U IfppnSrrnllB 1 - FmSrrr

File Edit View Insert Format Debug Run Tools Add-Ins Window Help ilgliaMHl « > I, . M, i# #

Properties Frame 1 |

Form Design Vba Autocad
Figure 10.8 Screenshot Illustrating the Setting of Object Properties

The following Names have b een assigned to the form components by setting their values in the Properties window:

RepBox: the text box used to store the rep name; SalesBox: the text box used to store the sales name; RepList: the list box used to store the rep list names.

0 0

Post a comment