I have a continuous form with 4 phone fields on it (Let's call them Phone1 ... Phone 4) (They are text fields)
I have a textbox (TxtPhoneFilter ) in the form footer where I enter part of the phone number.
On the OnChange of TxtPhoneFilter, I build a filter something like
This woks very sweetly and progressively filters the form, showing fewer and fewer records as more letters (digits) of the phone number are entered into TxtPhoneFilter.
So suppose we are down to 6 records = 24 phone numbers.
Now what I want to do is to highlight only those phone numbers that match TxtPhoneFilter.
Stymied. Any ideas please?
Phil
I have a textbox (TxtPhoneFilter ) in the form footer where I enter part of the phone number.
On the OnChange of TxtPhoneFilter, I build a filter something like
Code:
Sub TxtPhoneFilter_Change() Dim PhoneFltr As String ' If we return no records, tempotarily remove the filter If Me.RecordsetClone.RecordCount = 0 Then Me.FilterOn = False End If If Nz(TxtPhoneFilter) = "" Then Me.FilterOn = False End If TxtPhoneFilter.SetFocus If PhoneFltr > "" Then ' Media Type selected PhoneFltr = PhoneFltr & ") OR " End If PhoneFltr = PhoneFltr & "(sPhone1 Like '*" & Replace(Me.TxtPhoneFilter.Text, "'", "''") & "*'" If PhoneFltr > "" Then ' Media Type selected PhoneFltr = PhoneFltr & ") OR " End If PhoneFltr = PhoneFltr & "(Phone2 Like '*" & Replace(Me.TxtPhoneFilter.Text, "'", "''") & "*'" If PhoneFltr > "" Then ' Media Type selected PhoneFltr = PhoneFltr & ") OR " End If PhoneFltr = PhoneFltr & "(Phone3 Like '*" & Replace(Me.TxtPhoneFilter.Text, "'", "''") & "*'" If PhoneFltr > "" Then ' Media Type selected PhoneFltr = PhoneFltr & ") OR " End If PhoneFltr = PhoneFltr & "(Phone4 Like '*" & Replace(Me.TxtPhoneFilter.Text, "'", "''") & "*'" PhoneFltr = PhoneFltr & ")" Me.Form.Filter = PhoneFltr Me.FilterOn = True Me.TxtPhoneFilter.SetFocus ' Move the cursor to the end of the input text box. If Me.RecordsetClone.RecordCount = 0 Then Exit Sub End If Me.TxtPhoneFilter.SelStart = Len(Me.TxtPhoneFilter.Text)
So suppose we are down to 6 records = 24 phone numbers.
Now what I want to do is to highlight only those phone numbers that match TxtPhoneFilter.
Stymied. Any ideas please?
Phil
Comment