Filter Changing Focus of Textbox

slide

Registered User.
Local time
Today, 13:00
Joined
Apr 4, 2008
Messages
24
I have a textbox on my form and a sub bound to its change event, whenever someone is typing into the textbox i want to dynamically filter the results as they type. Right now each time i type a character it either highlights the entire textbox thus erasing what you already typed, or the focus jumps down to a field in the data area, is there anyway to prevent this?

Code:
Private Sub Term1_Change()
    If IsNull(Me.ActiveControl) Then
        Me.FilterOn = False
    Else
        Me.Filter = "Tag = """ & Me.ActiveControl & """"
        Me.FilterOn = True
    End If
End Sub
 
Well the problem with that is that filtering is going to refresh your form. I'm not sure of a way around that part, but to get it to stop moving to the next field, make sure Auto Tab is set to no.

What you will probably have to do is use a sub-form and filter that form, with your search box on the main form. I think that would work as the filter would only be refreshing the sub-form, not your main one. Not positive on that though.
 
Is there anyway to get a list of the fields available on a sub form?
 
What do you mean?...you should know what fields are on your subform.
 

Users who are viewing this thread

Back
Top Bottom