
Originally Posted by
uronmapu
I find this site before but my examply is listbox, not sub form
Could you edit in my file???
P/S: my file (HelpMe.mdb) is MS Access 2003 file
orange .......please see attached file and help my file?
Many thanks
Allen's example does not use a subform. He uses 2 combo boxes to select
a) the field to look in (choice of 3) and
b) the search string to look for.
And 3 text boxes to display results. Only 1 field can be searched at a time.
He also uses the AfterUpdate event of the second combo.
He then displays the non-Null found strings with appropriate html/rich text formatting. He updates the controlsource of the field to be displayed
using
Code:
'Control Source for the text box to display matches.
strControlSource = "=IIf(" & strField & " Is Null, Null, " & _
"Replace(" & strField & ", """ & strSearchValue & """, """ & _
strcTagStart & strSearchValue & strcTagEnd & """))"
where the variables are dimmed as
Code:
'Purpose: Filter, and highlight matches in txtSearchDisplay.
Dim strField As String 'The field to search
Dim strSearchValue As String 'The value to find
Dim strControlSource As String 'ControlSource for displaying match.
Const strcWildcard = "*" 'Some other back ends use %
'HTML tags for highlighting matches. Could be just "<b>" and "</b>".
Const strcTagStart = "<font color=""""red"""">"
Const strcTagEnd = "</font>"
I haven't had time to look into your database in any detail and won't be looking at it today.
Can you work with text boxes? Why must it be ListBox? What have you been doing regarding this issue and the sample code you have?
Perhaps someone following the thread may offer advice.