ComboBox.SelText Property
Access Developer Reference |
The SelText property returns a string containing the selected text. Read/write String.
Syntax
expression.SelText
expression A variable that represents a ComboBox object.
Remarks
If no text is selected, the SelText property contains a Null value.
The SelText property uses a string expression that contains the text selected in the control. If the control contains selected text when this property is set, the selected text is replaced by the new SelText setting.
To set or return this property for a control, the control must have the focus. To move the focus to a control, use the SetFocus method.
Example
The following example uses two event procedures to search for text specified by a user. The text to search is set in the form's Load event procedure. The Click event procedure for the Find button (which the user clicks to start the search) prompts the user for the text to search for and selects the text in the text box if the search is successful.
Visual Basic for Applications |
---|
|