1

Week In Review

In the first week, you learned about the relational database model, how to use the Visual Basic database objects access and update existing databases, and how to use the Visual Basic Data Manager program to create and maintain databases. You also learned how to design and code data entry forms, including use of the Visual Basic bound data controls, and how to create input validation routines at the keystroke, field, and form levels. Finally, you learned how to use the Visual Basic Crystal Reports report writer to design simple reports, and you learned how to use the CRYSTAL.VBX control to run those reports from within your Visual Basic programs.

Day 1, "Your First Database Program in Visual Basic"

The first day's lesson gave you a crash course in how to build a fully functional data entry form in Visual Basic with minimal programming code. On Day 1, you learned the following:

Day 2, "Creating Databases"

The lesson on Day 2 concentrated on the fundamentals of relational databases. You learned the following about relational databases:

You also learned the data field types recognized by Visual Basic 4. You constructed a data entry form that allows you to test the way Visual Basic behaves when attempting to store data entered into the various data field types.

Day 3, "Using the Data Manager"

On Day 3 you learned how to use the Data Manager that comes with Visual Basic 4 to perform the following database maintenance operations on Microsoft Access databases:

You also learned how the Data Manager can be used to perform database operations on non-Microsoft Access databases including the following:

Day 4, "Visual Basic Database Objects"

In this day's lesson, you learned that there are three types of Visual Basic data objects:

You also learned that there are two other Visual Basic data objects, both associated with the Visual Basic data control.

Day 5, "Creating Data Entry Forms with Bound Controls"

On Day 5, you learned about creating data entry forms with Visual Basic bound data controls.

You learned that the Visual Basic Data Control has five database-related properties. Three refer to the database and two refer to the Dynaset.

The Database properties of the Visual Basic data control are

  1. DatabaseName: Used to select the database to access.
  2. Exclusive: Used to prevent others from opening the database.
  3. ReadOnly: Used to prevent your program from modifying the data in the database.

The Dynaset properties of the Visual Basic data control are

  1. RecordSource: Used to select the data table within the database.
  2. Options: Used to set ReadOnly, DenyWrite, and AppendOnly properties to the Dynaset.

You learned that the Visual Basic data control has three database-related methods:

  1. Refresh: Used to update the data control after setting properties.
  2. UpdateControls: Used to read values from the fields in the Dynaset and write those values to the related form controls.
  3. UpdateRecord: Used to read values from the form controls and write those values to the related fields in the Dynaset.

You learned that the Visual Basic data control has three database-related events:

You learned how to use Visual Basic bound form controls to link form input and display controls to data fields in the database.

You also learned several general rules for creating Visual Basic forms in the Windows 95 style.

  1. The default color is light gray for backgrounds.
  2. Use the panel3D control to create a palette on which to place all other controls.
  3. The default font is 8 point sans-serif, regular.
  4. Input areas should have a background that is white; display areas should have a background that is light gray. Display areas should be recessed into the input palette.
  5. Use frame controls to group related items on a form.
  6. Left-justify all controls, including field prompts. Field prompts should be written in mixed case and followed by a semicolon.
  7. Standard spacing and sizing for common controls are as follows:

Lastly, you learned how to write code that sets control colors to the Windows 95 default colors, how to create your own custom color scheme, and how to link your control colors to the color scheme selected with the Windows Control Panel color applet.

Day 6, "Input Validation"

On this day, you learned how to perform input validation on data entry forms. You learned that input validation tasks can be divided into three areas:

You also learned that there are a few basic questions you can ask yourself when you are developing validation rules for your form.

You learned how to write keyboard filter validation functions using the Visual Basic KeyPress event. You learned how to write field-level validation functions that check for valid input ranges, input that is part of a list of valid data, and input that is within minimum and maximum length requirements. You also learned how to write validation functions that make sure dependent fields have been filled out properly. Finally, you learned how to create a Visual Basic library module containing validation functions that can be used in any Visual Basic program.

You also applied your knowledge of bound data controls, Visual Basic data entry form design, and validation processing to create the data entry form for the CompanyMaster database.

Day 7, "Creating Reports with Crystal Reports Report Writer"

You wrapped up your first week of study by learning how to use Crystal Reports to create a simple list report using the data tables you created earlier in the week. You also learned that Crystal Reports is a banded report writer. These are the main bands in a report:

You also learned that Crystal Reports recognizes three types of fields on the report form:

You also learned how to use the CRYSTAL.VBX to run a report from within your Visual Basic program. Finally, you created a generic print report dialog that lets you control the report destination, file type, and number of copies.