Searching does nothing for this topic, which is incredible. Such a fundamental function.
I am having trouble implementing a 'LIKE' wildcard clause for a textbox value in an SQL string.
Below is some code i've attempted. In any case, when the syntax is correct, no results return, which is due to the LIKE clause itself determined through troubleshooting.
Thanks for any help.
Regards,
Code:
Sub ()
Dim procid As Variant
Dim sqlSearchAll As String
Dim SQL As String
procid = tbProcID.Text
SQL = "SELECT MfgProcesses.ID FROM Vers_Process INNER JOIN MfgProcesses ON (Vers_Process.MaxOfVersion = MfgProcesses.Version) AND (Vers_Process.ID = MfgProcesses.ID) HAVING (((MfgProcesses.ID) LIKE '*" & procid & "*') ORDER BY MfgProcesses.ID;"
'NOTE: Vers_Process is a query named Vers_Process
End sub