Setting Up a Field for Picklist Help Using a Textbox_ Control

When you place a field on a form using a textbox control based on the VPME Textbox_ control class, the field will automatically have Picklist Help if you:

·       Referential Validation: Set up Referential validation for the field, and use the Picklist Builder to define a Picklist with the “<Default>” Picklist ID; or

·       Set Validation: Set up Set validation for the field.

To display the Picklist for the field, place the focus in the field and either (a) press F2, (b) right-click the field and select Picklist from the shortcut menu or (c) click the picklist icon.

When You Have Multiple Picklist Help Definitions

If you have created more than one Picklist Help definition for a field and if you want to use a Picklist Help definition other than the definition with the “<Default>” Picklist ID, do the following:

1.   Place the field on a form using a textbox control based on the VPME Textbox_ control class.

2.   Enter the Picklist ID of the Picklist Help definition that you want to use into the control’s cPickListID property.

Displaying a Descriptive Expression

If the field uses Referential validation, you can display a descriptive expression constructed from fields in the Picklist table in the text box instead of the foreign key field specified in the textbox control’s ControlSource property.

Ř To display a descriptive expression in the text box

1.   Edit the form in the Visual FoxPro Form Designer. Select the field’s textbox control and set the following properties.

2.   cLookupDDTVName: If the Picklist Cursor is not opened through the form’s DE, this property can be used to specify the table, view, or CursorAdapter to be opened. If a table, the extension must be included.

3.   cLookupDDDName: This property is used to specify the database or CursorAdapter library that contains the table, view, or CursorAdapter specified in the cLookupDDTVName property.

4.   cLookupAlias: In the cLookupAlias property enter the alias of the Picklist Cursor that is opened by the form’s DE, or the alias that you want to assign to the Picklist Cursor that is opened through the cLookupDDTVName and cLookupDDDName properties.

5.   lLookupDescription: Set the textbox control’s lLookupDescription property to .T. (the default is .F.).

6.   cLookupExpression: In the cLookupExpression property enter the expression to be displayed in the textbox with the Picklist Cursor alias included in field references.

7.   cLookupFKExpression: Normally, a FK Tag is specified when you set up Referential validation for a field. However, if for some reason a FK Tag is not specified for the field in the Referential validation setup, enter the foreign key tag expression in the cLookupFKExpression property.

Tip – Picklist View or CursorAdapter: If you use a Picklist view or CursorAdapter to display a descriptive expression. the view or CursorAdapter must contain a filter with the special "PKValue" variable name.

How to Delete the Descriptive Expression Entry on a Form

There may be times when an application user needs to delete the entry in a text box that displays a descriptive expression on a form. To delete the entry, simply press the Delete key when the focus is on the textbox control.

The Delete key is the default “reset” key. You can specify the “reset” key and value through properties of the VPME Textbox_ class. For more information, see the following Textbox_ properties in the VPME Technical Reference manual: lKeyPressReset, nKeyPressReset_KeyCode, nKeyPressReset_ShiftAltCtrl and KeyPressResetValue. Also check out the KeyPress event of Textbox_ control class to see how these properties are used.

Turning off Picklist Help for a Textbox Control

If you have set up Referential or Set validation for a field, but you don’t want the field to have Picklist Help when you put it on a form with a textbox control, you can prevent Picklist Help and the display of the Picklist icon by setting the textbox control’s lPicklist property to .F. (false).

More:

Setting Up a Field for Picklist Help Using a Combobox_ Control