I don't have time to review all the code, but the first thing you should do is change this code:
"SELECT " & vbCrLf & _
"dbo.V_PAT_NHS.Patnt_RefNo_NHS_Identifier, " & vbCrLf & _
"dbo.V_PAT_NHS.Forename, " & vbCrLf & _
"dbo.V_PAT_NHS.Surname " & vbCrLf & _
"FROM dbo.V_PAT_NHS " & vbCrLf & _
"WHERE dbo.V_PAT_NHS." + Me.cboSearchOn + " LIKE '%" & Me.txtInputSearch.Text & "%' " & vbCrLf & _
"ORDER BY dbo.V_PAT_NHS.Patnt_RefNo_NHS_Identifier "
to this:
"SELECT " & _
"dbo.V_PAT_NHS.Patnt_RefNo_NHS_Identifier, " & _
"dbo.V_PAT_NHS.Forename, " & _
"dbo.V_PAT_NHS.Surname " & _
"FROM dbo.V_PAT_NHS " & _
"WHERE dbo.V_PAT_NHS." + Me.cboSearchOn + " LIKE '%" & Me.txtInputSearch.Text & "%' " & _
"ORDER BY dbo.V_PAT_NHS.Patnt_RefNo_NHS_Identifier "
Unless you are formatting the string for a text output, you should not have the carriage return line feed inserted. This may be ending your string prematurely, which is why there are no results. ANSI SQL will not work with those
vb cursor controls.
Did any of that help?
mmcdonal
Look it up at:
http://wrox.books24x7.com