I have a list of contract numbers like
123-4-567-890
I want to be able to search by any subsequence of numbers like:
123 - # - 4567 - ###
I have 4 list boxes with all instances of each number respectively. I
have another list box where I want the result of the query.
How is this done effectively?
Initially I had a parameter query that fetched the values from the
form like this:
[forms]![frmTG_CONT_2]![combo149] Or [forms]![frmTG_CONT_2]![combo149]
Is Null
[forms]![frmTG_CONT_2]![combo151] Or [forms]![frmTG_CONT_2]![combo151]
Is Null
[forms]![frmTG_CONT_2]![combo153] Or [forms]![frmTG_CONT_2]![combo153]
Is Null
[forms]![frmTG_CONT_2]![combo155] Or [forms]![frmTG_CONT_2]![combo155]
Is Null
under each subnumber respectively.
This was terrifyingly slow. Is there a better way?
I also attempted this which didn't work (Chr(42) is an astrix.):
----
Private Sub ListClick()
Dim String1 As String
Dim String2 As String
Dim String3 As String
Dim String4 As String
If IsNull(Me.Combo149) Then
String1 = Chr(42)
Else
String1 = Me.Combo149
End If
If IsNull(Me.Combo151) Then
String2 = Chr(42)
Else
String2 = Me.Combo151
End If
If IsNull(Me.Combo153) Then
String3 = Chr(42)
Else
String3 = Me.Combo153
End If
If IsNull(Me.Combo155) Then
String4 = Chr(42)
Else
String4 = Me.Combo155
End If
Me.Text175 = "like " & String1 & String2 & String3 & String4
Me.List172.Requery
End Sub
------
Christian