Find - Standard

When you click a form's Find toolbar control, VPM Enterprise displays the Standard Find Form (unless the form is set up to use the SQL Find Form).

The Standard Find Form allows you to quickly find records using the fields in either the active cursor’s current index key or primary key. The fields in the current index key are displayed in the top half of the Find Form. The field(s) in the primary key are displayed in the bottom half. You can enter values into either key fields to Find a record.

When you change the order of the records displayed on a form through the Order toolbar control, the current index key fields are automatically changed the next time the Find Form is displayed.

How the Standard Find Form Finds Records

Partial Entries: The Standard Find Form finds records that match whatever characters you enter into the current index key or primary key fields. For example, using the Find Form illustrated above, a partial entry of “B” in the Last Name field would find all records with a Last Name that began with “B”.

Key Precedence: The Find control gives precedence to entries for the primary key. That is, if you make entries on the Find dialog for both the current index key and the primary key, the Find will find records that match the primary key entry. If no records match the primary key entry, the Find will find records, if any, that march the current index key entry.

Find List Grid: If more than one record meets the search criteria entered, VPM Enterprise displays all the records that meet the search criteria in a searchable, sortable grid. You can highlight a record and close the grid to display the record on the form. Using the Find dialog illustrated above, if an entry of “B” were made in the Last Name field, VPM Enterprise would display the grid below.

Tip: The fields in the Find grid are the fields you select for the Toolbar List control. See ProMatrix Toolbar List Builder. If you do not set up the Toolbar List control for a form, the Find grid will not appear if more than one record meets the search criteria; instead, the first record found will be displayed on the form.

Use Match Case for a Faster Search

The Find dialog contains a Match Case check box that will cause the Find to perform a case-sensitive search for character fields. The case-sensitive search is faster because it doesn’t use the UPPER function required when case is ignored.

The fields on the Find dialog use the Format property stored in the Data Builder. If the Format contains an “!” to force upper case entry, the Match Case check box is automatically checked and the case-sensitive search will be performed. 

Important Tip: If you force a character field to upper case entry by using an Input Mask with an “!”, the fast case-sensitive Find will always be performed for the field.  Entries into the table, view or CursorAdapter field on a data form will be forced to upper case. When a user performs a Find on the field:

1.   The Match Case check box will be automatically checked on the Find dialog, and

2.   Your entry into the field on the Find dialog will be forced to upper case, which will match the case of entries in the table, view or CursorAdapter field. 

This approach automatically results in the fast case-sensitive search without requiring the user to worry about the case of the entry on the Find dialog. However, it must be acceptable for the character field to contain all upper case letters.

How to Change the Find Fields - cFindFields

The Find control by default displays fields in the current index tag and fields in the primary key tag. You can use the cFindFields property of the form to change the fields displayed on the Find dialog and used in the search.

To specify the fields for the Find control, enter a comma-delimited list of the fields that you want to appear on the Find dialog into the form’s cFindFields property. The list of fields you enter will be used in lieu of the default fields. The Find control will then search for records that match the entries made into the fields displayed.

Displaying the Standard Find Form at Form Startup

lStartWithFind Property: When you set a form's lStartWithFind property to .T. for a form that uses the Standard Find Form, the Standard Find Form is displayed when the form starts up. A user can then select a record to be displayed on the form or the records to be included in the list grid.

How to Change the Standard Find Form

When the Standard Find form is accessed, the RunFindForm method of the form runs the form specified in the form properties cFindForm and cFindForm_ClassLibrary. cFindForm contains the name of the Find form or form class. cFindForm_ClassLibrary contains the name of the class library that contains the Find form class, if any. By default, the Standard Find form is instantiated from the Find class in the PROGEN.VCX class library.

Specific Forms: If you create your own Standard Find form or form class and want to use it with the Find Toolbar control for a particular form, simply enter your Standard Find form name or form class name into the form’s cFindForm property. If you are using your own Find form class, enter the name of the class library that contains the form class into the cFindForm_ClassLibrary property. Rebuild the application. The next time you click on the Find toolbar control, your Standard Find form will appear.

All Forms: If you want to use your own Standard Find form or form class with all forms in an application, make the property entries in the properties of the Form_Toolbar class (and subclasses) in the application’s PROGEN.VCX class library. If you want your own Standard Find form to be used by all forms in all applications, make your changes at the VPM or DEV level.


Find - SQL