If a foreign key field uses a view or CursorAdapter for its Picklist, you can use the VPME SQL Find Form to limit the records displayed in the Picklist. The SQL Find Form is displayed before the Picklist and allows users to enter criteria to be used to select the records to be included in the Picklist Cursor. (See Find – SQL to learn more about the SQL Find Form.)
This is a particularly useful feature when the Picklist Cursor is based on a remote table in a client-server application. The SQL Find Form limits the records included in the Picklist Cursor and, thereby, significantly decreases the time it takes to create the Picklist.
To use the SQL Find Form with a Picklist view or CursorAdapter, you must:
1. FIND<field name> Parameters: Set filters on the Picklist view or CursorAdapter fields that will appear on the SQL Find Form using variables named "FIND<field name>, where "field name" is the name of the field that is being filtered. See View Filters and CursorAdapter Filters.
2. lFindForm_SQL: Set the lFindForm_SQL property of the Textbox_ or Combobox_ control to .T.
The Textbox_ and Combobox_ control classes have the following four properties that let you control the SQL Find Form:
· cFindForm_SQL: You can enter the name of the form class from which the SQL Find Form is instantiated. By default, this property contains “find_sql”.
· cFindForm_SQL_ClassLibrary: Enter the name of the class library that contains the class specified in the cFindForm_SQL property. By default, this property contains “progen”.
· cFindForm_SQL_AltCaptions: You can specify alternate field label captions to be displayed on the SQL Find Form. The captions should be entered into this property in the order in which the associated parameters will be displayed on the SQL Find Form. Multiple captions should be separated by semi-colons. Captions can be entered selectively, meaning that only those captions that should be different than the captions that would be used by default from the data dictionary need to be specified.
· lFindForm_SQL_NoEntriesOK: When set to .T., allows the user to not make any entries on the SQL Find Form, click OK, and be presented with a Picklist form showing all records in the Picklist table. The property is .F. by default, meaning the user has to enter at least one parameter value before clicking OK.