Sams Teach Yourself Visual Basic 6 in 24 Hours
- Table of Contents
- Copyright
- About the Author
- Acknowledgments
- Introduction
- Who Should Read This Book
- What This Book Will Do for You
- Can This Book Really Teach Visual Basic in 24 Hours?
- What You Need
- Files on the Visual Basic Distribution CD-ROM
- Conventions Used in This Book
- Enough! Time Is Ticking!
- Part I: Introducing Visual Basic
- Hour 1. Visual Basic at Work
- Hour 2.Analyzing Visual Basic Programs
- Hour 3.Controls and Properties
- Hour 4.Examining Labels, Buttons, and Text Boxes
- Part II: Coding the Details
- Hour 5.Putting Code into Visual Basic
- Hour 6.Message and Input Boxes
- Hour 7.Making Decisions
- Hour 8.Visual Basic Looping
- Part III:Putting Code to Work
- Hour 9.Combining Code and Controls
- Hour 10.List Boxes and Data Lists
- Hour 11.Additional Controls
- Hour 12.Dialog Box Basics
- Part IV:Programming with Data
- Hour 13.Modular Programming
- Hour 14.Built-In Functions Save Time
- Hour 15.Visual Basic Database Basics
- File Concepts
- Introduction to Database Processing
- The Data Form Wizard
- Summary
- Q&A
- Workshop
- Hour 16.Printing with Visual Basic
- Part V:Sprucing Up Programs
- Hour 17.Menus and Visual Basic
- Hour 18.The Graphic Image Controls
- Hour 19.Toolbars and More Graphics
- Hour 20.Writing Correct Applications
- Part VI:Advancing Visual Basic Applications
- Hour 21.Visual Basic and ActiveX
- Hour 22.Object Basics
- Hour 23.Distributing Your Applications
- Hour 24.Online Visual Basic
- Part VII:Appendixes
- Appendix A.Operator Precedence
- Appendix B.Answers
- Appendix C.Using the CD-ROM
The Data Form Wizard
The Data Form Wizard analyzes a database, locates the fields for you (you don't have to know the format of the database ahead of time), and automatically builds a form that contains an appropriate title, field names, Text Box controls for the fields, and the Data control you can use to move between the records. If you want to follow along with this exercise, start a new VB project and remove any projects currently loaded in VB.
An add-in application is a tool that extends Visual Basic's development environment.
To access the Data Form Wizard, select Add-Ins | Add-In Manager. When the Add-In Manager dialog box appears, select the VB 6 Data Form Wizard and check the Loaded/Unloaded check box. Click OK to continue. Now select Add-Ins | Data Form Wizard. Visual Basic displays the Data Form Wizard's opening window. When you click Next, you see the database-selection dialog box shown in Figure 15.2.
Figure 15.2 The Data Form Wizard's database selection tool.
Continue following the wizard's requests to create the form. For example, you will have to tell the wizard the kind of database for which you want to create a form. After you select a database, the next dialog box asks you for the database name (which you can browse for) and a data source such as a table or query. Select the kind of form and then on the Record Source dialog box, you must select a table. Copy all the fields you want from that table to the final form. You then can click the options you want and click Finish to generate the form.
The form that the Data Form Wizard generates might not be as unique as the one you create yourself, but the form does include buttons that let the user not only change the database data, but also add and delete records as well, as Figure 15.3 shows.
Figure 15.3 The Data Form Wizard creates a nice form.
Summary | Next Section

Account Sign In
View your cart