aeroposcot
Programmer
I have a combo box that is filtering a form. The combo box contains employee's last name. However, the field that it is looking up can contain more than one name (e.g., possibilities include just Smith, Smith & Johnson, Smith & Jones & Johnson, etc.).
Thus, when I click on the combo box, I want all records containing "Smith" to show up. However, I have only been able to bring up exact matches. Here is my code. Thanks in advance.
Here's my code:
Dim strSQL As String
Dim strSQLSF As String
Status_CB = Null
strSQL = "SELECT * FROM Pipeline"
strSQL = strSQL & " WHERE Pipeline.[Lead_Person(s)] LIKE '" & S_MD_CB & "' "
strSQL = strSQL & " ORDER BY Pipeline.Status;"
Status_CB.RowSource = strSQL
strSQLSF = "SELECT * FROM Pipeline "
strSQLSF = strSQLSF & "WHERE Pipeline.[Lead_Person(s)] LIKE '" & S_MD_CB & "' "
Me!Data_Entry_SF.LinkChildFields = "[Lead_Person(s)]"
Me!Data_Entry_SF.LinkMasterFields = "[Lead_Person(s)]"
Me.RecordSource = strSQLSF
Me.Requery
Thus, when I click on the combo box, I want all records containing "Smith" to show up. However, I have only been able to bring up exact matches. Here is my code. Thanks in advance.
Here's my code:
Dim strSQL As String
Dim strSQLSF As String
Status_CB = Null
strSQL = "SELECT * FROM Pipeline"
strSQL = strSQL & " WHERE Pipeline.[Lead_Person(s)] LIKE '" & S_MD_CB & "' "
strSQL = strSQL & " ORDER BY Pipeline.Status;"
Status_CB.RowSource = strSQL
strSQLSF = "SELECT * FROM Pipeline "
strSQLSF = strSQLSF & "WHERE Pipeline.[Lead_Person(s)] LIKE '" & S_MD_CB & "' "
Me!Data_Entry_SF.LinkChildFields = "[Lead_Person(s)]"
Me!Data_Entry_SF.LinkMasterFields = "[Lead_Person(s)]"
Me.RecordSource = strSQLSF
Me.Requery