Partilhar via


AutoCompSource Property

Specifies the Source field in the table that tracks text for auto-completion functionality in a Text box control. Read/write at design time and run time.

cTextbox.AutoCompSource [= cValue]

Return Value

  • cValue
    Name of the field in the auto-completion table associated with the text box.

Remarks

Applies to: TextBox Control (Visual FoxPro)

Specifies the Source name used for looking up data in the AutoComp table. This field is case-insensitive and is stored as uppercase in the AutoComp table.

When entries are written to or read from the AutoComp table, they use a key, which is the Source field. By default, if this property is not specified, then the name of the text box becomes the key value in that field of the AutoComp table.

You can write applications that use a single AutoComp table that supplies values to several text box controls within a single application.

The Source field in the AutoComp table is limited to 20 characters. You should ensure that your AutoCompSource property is limited to this amount. The control's Name property is used if you do not specify an AutoCompSource value. If the source used is longer than 20 characters, it is truncated to its first 20 characters for lookup against the Source field in the Autocomp table.

Example

For example, you might have many forms that have an Address field. By setting the AutoCompSource property to “myAddress” for each text box that displays an address field, you can reuse the entries of the AutoComp table throughout your entire application.

AddressForm.AddressText1.AutoCompSource = 'myAddress'

See Also

Reference

TextBox Control (Visual FoxPro)
AutoCompTable Property
AutoComplete Property

Other Resources

Properties (Visual FoxPro)