Data Form Wizard

The Data Form Wizard is designed to automatically generate Visual Basic forms that contain individual bound controls and procedures used to manage information derived from database tables and queries. You can use the Data Form Wizard to create either single query forms to manage the data from a single table or simple query, or Master/Detail type forms used to manage more complex one-to-many data relationships. If you are using a control, you can also create a grid or datasheet type form. The Data Form Wizard is used in conjunction with only the ADO Data control.

Use the Data Form Wizard to:

  • Rapidly build forms with controls bound to a data source.

  • Create single record, grid, and Master/Detail forms.

  • Rapidly create prototype data-based forms.

Since you can create three types of forms, some steps of the Data Form Wizard are different for each type.

  • To create single table forms or forms with a grid (datasheet) layout, the Data Form Wizard follows these steps:
    • Introduction

    • Database Type

    • Database

    • Form

    • Record Source

    • Control Selection

    • Finished!

    Note The grid or datasheet form layout is not available when you choose a code as a binding type.

  • To create Master/Detail forms, the Data Form Wizard follows these steps:
    • Introduction

    • Database Type

    • Form

    • Master Record Source

    • Detail Record Source

    • Record Source Relation

    • Control Selection

    • Finished!

In addition to the previous steps, data forms that contain ADO Data controls, also have a Connect Information step.


Topic Not Found

No matching topic was found. Some possible reasons and remedies are as follows:

  • The file (.chm) that contains the destination topic is not in the expected location.

    Remedy: Rerun the MSDN Library Setup.

  • The file (.chm) that contains the current topic or destination topic is out-of-date and the link is no longer valid.

    Remedy: Install the latest version of the MSDN Library.

  • The MSDN Library CD is not in the CD-ROM drive.

    Remedy: Insert the MSDN Library CD into the CD-ROM drive.


bound control

A data-aware control that can provide access to a specific column or columns in a data source through an ADO Data control. A data-aware control can be bound to an ADO Data control through its DataSource and DataField properties. When an ADO Data control moves from one row to the next, all bound controls connected to the ADO Data control change to display data from columns in the current row. When users change data in a bound control and then move to a different row, the changes are automatically saved in the data source.


join

A join is the database process of comparing the data in specified columns and using the comparison results to form a new table or record set from the rows that qualify.

Specifically, a join statement:

  • Specifies a column from each table.

  • Compares the value in those columns row by row.

  • Combines data from rows with qualifying rows into a new table or record set.


procedure

A named sequence of statements executed as a unit. For example, Function, Property, and Sub are types of procedures. A procedure name is always defined at a module level. All executable code must be contained in a procedure. Procedures can't be nested within other procedures.


query

A formalized instruction to a database to either return a set of rows or perform a specified action on a set of rows, as specified in the query. For example, the following SQL query statement returns rows:

SELECT CompanyName FROM Publishers WHERE State = 'NY'

You can create and run select, action, parameter, and stored procedure queries.


Data Form Wizard--Control Selection

Data Form Wizard—Control Selection

Allows you to choose the controls you want to appear on the form and enables the wizard to create the associated code for each control.

Wizard Options

Available Controls

Lists the controls available for your form.

  • Add Button — When checked places an Add button on the form with the associated code to add new records to the database.

  • Update Button — When checked places an Update button on the form with the associated code to update data in the database from the form. The Update button is available only when you select a Data control.

  • Edit Button — When checked places an Edit button on the form with the associated code to allow editing of the record. The Edit button is available only when you select a code-only form.

    Note Update and Cancel buttons will be provided on code-only forms if you select either of the Add or Edit buttons.

  • Delete Button — When checked places a Delete button on the form with the associated code to delete records from the database.

  • Refresh Button — When checked places a Refresh button on the form with the associated code to refresh data from the database.

  • Close Button — When checked places a Close button with the associated code to close your form.

  • Show Data Control — When checked makes the Data Control visible on your form.

    Note The Show Data Control option is available only when you have a grid (datasheet) form layout and are using a Data control.

Select All

Selects all available controls.

Clear All

Clears all available controls.

Help

Opens the Help topic for this step. You can also press F1 for help.

Cancel

Cancels your previous actions and closes the Data Form Wizard.

Back

Moves you to the previous step.

Next

Moves you to the next step.

Finish

Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard--Database

Data Form Wizard—Database

Allows you to select the database file and binding type you want to use for your data form. This is used when your database type is not Remote (ODBC).

Wizard Options

Database Name

Lets you enter the name of the database file or displays the name of the database file you selected using Browse.

Browse

Displays the Open dialog box so you can search for the database file you want to use.

Choose from (Only available for Microsoft Access databases (.MDB).)

Lets you choose which type of source you want to use.

  • Tables — Displays tables from the database you selected.

  • Queries — Displays query definitions from the database you selected.

Help

Opens the Help topic for this step. You can also press F1 for help.

Cancel

Cancels your previous actions and closes the Data Form Wizard.

Back

Moves you to the previous step.

Next

Moves you to the next step.

Finish

Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard--Database Type

Data Form Wizard—Database Type

Allows you to select the format of the data source you want to use for this form.

Wizard Options

Database Formats List

Lists the database formats available to Visual Basic. The available database formats are:

  • Access — Any version of the Microsoft Access .MDB (Jet) database.

  • Remote ( ODBC) — Any ODBC-compliant database driver.

Help

Opens the Help topic for this step. You can also press F1 for help.

Cancel

Cancels your previous actions and closes the Data Form Wizard.

Back

Moves you to the previous step.

Next

Moves you to the next step.

Finish

Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard--Finished!

Data Form Wizard—Finished!

Allows you to give your form a name and to save the current settings as a default so that you can create additional forms using the same settings.

Wizard Options

Name box

Lets you give a meaningful name to your saved project. The default is (None).

If you chose (None), your project will not be saved.

Displays the Save Profile dialog box where you can name and select a location in which to save your settings.

Note Your application will be saved in memory but not on your disk unless you use the Save Project command on the File menu after the application is created.

Help

Opens the Help topic for this step. You can also press F1 for help.

Cancel

Cancels your previous actions and closes the Data Form Wizard.

Back

Moves you to the previous step.

Next

Unavailable because there are no additional steps for the Data Form Wizard.

Finish

Creates a data form based on the settings you selected.


Data Form Wizard--Form

Data Form Wizard—Form

Allows you to select the type of form you want to create.

Wizard Options

Name for Form

Allows you to type the name you want to give your form.

Form Layout

List options for the layout of your data form.

  • Single record — Specifies a form that displays one record at a time. This is the default.

  • Grid (Datasheet) — Specifies a form that displays the selected fields in the Grid (Datasheet) format using the DataGrid control.

  • Master/Detail — Specifies a form that displays a Master record source and a Detail record source linked together. The Master record source is in single record format and the Detail record source is in a Grid (Datasheet) format. When data in a Master record source row changes, the data in the Detail record source automatically changes based on the link between the two.

  • MS HFlex Grid — Specifies a form that displays tabular data.

  • MS Chart — Specifies a form that displays data in a chart format

Binding Type

Allows you to choose to use a ADO Data Control, ADO code, or Data Class to access the specified data.

  • ADO Data Control — Uses the ADO Data Control to access the specified data.

  • ADO Code — Uses ADO code to access the specified data.

  • Data Class — Uses Data Classes to access the specified data.

Help

Opens the Help topic for this step. You can also press F1 for help.

Cancel

Cancels your previous actions and closes the Data Form Wizard.

Back

Moves you to the previous step.

Next

Moves you to the next step.

Finish

Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard--Introduction

Data Form Wizard—Introduction

The Data Form Wizard is designed to automatically generate Visual Basic forms that contain individual bound controls and procedures used to manage information derived from local or remote data sources. You can use the Data Form Wizard to create single query forms to manage the data from a single table or query, Master/Detail type forms to manage more complex one-to-many data relationships, or grid (datasheet) forms to manage data from a control. The Data Form Wizard is used in conjunction with the ADO Data control.

Wizard Options

Profile List

Allows you to choose a wizard profile from the list previously saved profiles. A wizard profile (.rwp) is a file that contains the settings you chose and saved when you previously ran the Data Form Wizard. To run the Data Form Wizard without previously saved settings, choose (None).

Profiles are useful if you create multiple applications with the same overall look. You do not have to remember and choose the same options every time you create an application.

Displays the Open Profile dialog box where you can locate and open a profile.

Help

Opens the Help topic for this step. You can also press F1 for help.

Cancel

Cancels your previous actions and closes the Data Form Wizard.

Back

The Back button is unavailable on the Introduction step.

Next

Moves you to the next step.

Finish

Accepts the defaults and builds the appropriate data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard--Master Record Source

Data Form Wizard—Master Record Source

Allows you to choose the record source and fields of the record source to place on the Master form.

Wizard Options

Record Source

Lists available record sources in the database you chose.

Available Fields

Lists the available fields in the selected record source.

Selected Fields

Lists the fields to include in your form.

Moves the selected field in the Available Fields list to the Selected Fields list.

Moves all of the fields in the Available Fields list to the Selected Fields list.

Moves the selected field in the Selected Fields list to the Available Fields list.

Moves all of the fields in the Selected Fields list to the Available Fields list.

Changes the order of the fields on your form. Each time you click the button, the selected field in the Selected Fields list moves up one position.

Changes the order of the fields on your form. Each time you click the button, the selected field in the Selected Fields list moves down one position.

Column to Sort By

Specifies the field you want to use for sorting.

Help

Opens the Help topic for this step. You can also press F1 for help.

Cancel

Cancels your previous actions and closes the Data Form Wizard.

Back

Moves you to the previous step.

Next

Moves you to the next step.

Finish

Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard--Record Source

Data Form Wizard—Record Source

Allows you to choose the record source and fields within the record source to place on the form.

Wizard Options

Record Source

Lists available record sources in the database you chose.

Available Fields

Lists the available fields in the selected record source.

Selected Fields

Lists the fields to include in your form.

Moves the selected field in the Available Fields list to the Selected Fields list.

Moves all of the fields in the Available Fields list to the Selected Fields list.

Moves the selected field in the Selected Fields list to the Available Fields list.

Moves all of the fields in the Selected Fields list to the Available Fields list.

Changes the order of the fields in your form. Each time you click the button, the selected field in the Selected Fields list moves up one position.

Changes the order of the fields on your form. Each time you click the button, the selected field in the Selected Fields list move down one position.

Column to Sort By

Specifies the field you want to use for sorting.

Help

Opens the Help topic for this step. You can also press F1 for help.

Cancel

Cancels your previous actions and closes the Data Form Wizard.

Back

Moves you to the previous step.

Next

Moves you to the next step.

Finish

Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard--Record Source Relation

Data Form Wizard—Record Source Relation

Allows you to create a one-to-many join between the Master and Detail record sources This step only appears if you chose the Master/Detail type of data form.

Wizard Options

Master Record Source

Lists all available fields from the record source you specified in the Master Record Source step. Clicking a field highlights it and registers it as the linking field for this record source.

Detail Record Source

Lists all available fields from the record source you specified in the Detail Record Source step. Clicking the same field in this list highlights it and registers it as the linking field for the second record.

Help

Opens the Help topic for this step. You can also press F1 for help.

Cancel

Cancels your previous actions and closes the Data Form Wizard.

Back

Moves you to the previous step.

Next

Moves you to the next step.

Finish

Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard--Connect Information

Data Form Wizard—Connect Information

Collects the information needed to connect to an ODBC data source and allows you to select the type of binding type you want to use. This step only appears if you chose Remote (ODBC) for the database format in the Database Type step.

Wizard Options

ODBC Connect Data

Collects information needed to connect to a remote data source.

  • DSN ( Data Source Name) — Displays a list of DSNs currently installed on your computer to which you can connect. Use the 32-bit ODBC icon in the Control Panel to install new DSNs. Not available if you select a driver.

  • UID (User ID) — Allows you to type the User ID required to connect to this data source. If the data source does not require a user ID, you can leave this blank. Not available if you select a driver.

  • PWD (Password) — Allows you to type the password required to connect to the data source. If the data source does not require a password, you can leave this blank. Not available if you select a driver.

  • Database — Allows you to type the name of the database to which you want to connect. Not available if you select a driver.

  • Driver — Displays a list of drivers currently available on your computer that you can use to create a connection to a Remote data source. Not available if you select a DSN.

  • Server — Allows you to type the name of the server where the database resides. Not available if you select a DSN.

Help

Opens the Help topic for this step. You can also press F1 for help.

Cancel

Cancels your previous actions and closes the Data Form Wizard.

Back

Moves you to the previous step.

Next

Moves you to the next step.

Finish

Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard--Detail Record Source

Data Form Wizard—Detail Record Source

Asks you to choose the second record source (Detail) and the fields you want to use from it. This step only appears if you choose the Master/Detail type of data form.

Wizard Options

Record Source

Lists available record sources in the database you chose.

Available Fields

Lists the available fields in the specified record source.

Selected Fields

Lists the fields you want to include in your form.

Moves the selected field in the Available Fields list to the Selected Fields list.

Moves all of the fields in the Available Fields list to the Selected Fields list.

Moves the selected field in the Selected Fields list to the Available Fields list.

Moves all of the fields in the Selected Fields list to the Available Fields list.

Changes the order of the fields on your form. Each time you click the button, the selected field in the Selected Fields list moves up one position.

Changes the order of the fields on your form. Each time you click the button, the selected field in the Selected Fields list moves down one position.

Column to Sort By

Specifies the field you want to use for sorting.

Help

Opens the Help topic for this step. You can also press F1 for help.

Cancel

Cancels your previous actions and closes the Data Form Wizard.

Back

Moves you to the previous step.

Next

Moves you to the next step.

Finish

Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.