I have some problems with a search function, or more precise the error-handling of the function.
Iíve added an unbounded textbox (Called search) in the toptext of a continuous form. The form is based on a query which is connected to the unbounded textbox (search).
Iíve written a basic vb function with is activated by the textbox (on change).
Private Sub search_Change()
Dim toSearch As String
.SelStart = 300
This works well, until there are no more posts to show. Then I get:
Run-time error Ď2185í Ė You can't reference a property or method for a control unless the control has the focus
The cause is the .SelStart = 300. Without that line, the Run-time error will not occur. But, the line has to stay..
Iíve tried all the Ifís and elseís I know, but could not find a fix. Any ideas?