Basic Steps to Create a Form

This section reviews the basic steps to create a form in VPM Enterprise without using a VPM Enterprise Form Builder. It gives you an idea of what's involved.

Ř To create a form in VPM Enterprise: Basic Steps

1.   Check Form and Control Class Libraries: Before you create any form, always make sure that the default form class template and the registered form and control class libraries are correct for the project. Open the Options dialog on the Visual FoxPro Tools menu and check the Forms and Controls tabs. See Setting Up VFP Options for Form and Control Classes for more details on this subject.

2.   Open Form Editor: Use the Object Builder to open a Form Editor for a new form by either creating a menu option for the form or by adding the form to another Object Editor's Called Objects list. 

Visual FoxPro Project Manager:  In VPM Enterprise you can create forms through the Visual FoxPro Project Manager as well as through the Object Builder. 

3.   Select Copy or Blank: When you click the Edit button on the Form Editor the first time, VPM Enterprise displays the New Form dialog. You can select whether to Copy an existing form or to start with a Blank form based on a form class you select or on the default form class template.

4.   Select Form Class: If you choose to start with a blank form based on a form class you select, click OK and the Select Form Class dialog opens allowing you to select the form class that you want to use.

5.   Form Designer: After you click OK on the New Form or Select Form Class dialog, the Visual FoxPro Form Designer appears with a form based on the form class you selected or on the default form class template selected in the Options dialog.

Tip: If you decide that you want to use a different form class, change it now.

6.   Enter Unique Form Name: Enter a unique form name in the Name property of the form. VPM Enterprise uses the form name to keep track of data needed to implement certain form-level functionality. Therefore, you must give each form in an application a unique name.

7.   Add Data and Controls: If the form uses data from tables, views and CursorAdapters, use the Data Environment to set up the tables, views and CursorAdapters and to add fields to the form. You will need to set certain properties for the Data Environment. The next section describes the properties you will need to set.

   Add controls to the form by dragging and dropping fields from the Data Environment onto the form.

8.   Private Data Sessions: Decide whether you want to use a private data session for the form. Generally, if you want multiple instances for your form or if the tables, views and CursorAdapters the form uses could be used by other forms at the same time, you should use a private data session. By default VPME forms that edit tables, views and CursorAdapters use private data sessions. To turn off a private data session for a form, set the form’s DataSession property to “1”.

9.   Find Form: You can choose to display the VPME Standard or SQL Find Form at form startup by setting a form property. The next section describes the property that you need to set. See Find Forms to learn more about the VPME Standard and SQL Find Forms.

10. Run ProMatrix Control Builder: Select the field controls that you added to the form from the Data Environment and run the ProMatrix Control Builder. The ProMatrix Control Builder changes the field controls classes to the ProMatrix control classes and adds Label Captions for the fields from the Data Builder.

VPM Enterprise Form Labels are Data-Driven!!: The labels that the ProMatrix Control Builder adds to a form are the field Description (Long) property entries from the Data Builder. When you run a form, the labels are taken from the Data Builder. You or users of your VPM Enterprise applications can change the field labels on a form through the Data Builder!!

Tip – Picklist Help: If a field is a foreign key set up in the Data Builder with Referential or Set validation, choose a VPME textbox or combobox control and set up the control properties to get the Picklist behavior you want. See Building Data: Picklist Help.

11. Run ProMatrix Toolbar List Builder: If your form is based on the VPM Enterprise Form_Toolbar class or a subclass thereof, run the ProMatrix Toolbar List Builder to create a customized toolbar List control grid for the form. See ProMatrix Toolbar List Builder.

12. Run ProMatrix Condition Field List Builder: If your form is based on the VPM Enterprise Form_Toolbar class or a subclass thereof, run the ProMatrix Condition Field List Builder to select the fields that will appear in the form’s Condition Builder Field list. See ProMatrix Condition Field List Builder.

13. Test the Form: Run the form to test it. There are several ways to run the form as described in the next section.


Special Steps for Views and CursorAdapters