Hi
I have a form with a box on it where a user can type something, called searchbox.
I want to send a sql statement to a list box on another form, which will look up the name of a site, based on the text typed in the searchbox. I want to use the like statement, so it will search for the word in any part of the site name.
The sql text I have is:
sqltext = "SELECT Q_Search_All.RFC_Number, Q_Search_All.Version_Number, Q_Search_All.Date_Recd, Q_Search_All.Record_Number, Q_Search_All.IA_Status_Narr, Q_Search_All.Site_Name WHERE Q_Search_All.Site_Name like *" & Me.SearchBox & "* FROM Q_Search_All ORDER BY [RFC_Number], [Version_Number]; "
But it finds no records, even though loads of sites exist where the letters exist. I'm guessing I havent written the syntax right in the sql statement around the like clause.... any ideas what I have done wrong?
Thanks
Gary
I have a form with a box on it where a user can type something, called searchbox.
I want to send a sql statement to a list box on another form, which will look up the name of a site, based on the text typed in the searchbox. I want to use the like statement, so it will search for the word in any part of the site name.
The sql text I have is:
sqltext = "SELECT Q_Search_All.RFC_Number, Q_Search_All.Version_Number, Q_Search_All.Date_Recd, Q_Search_All.Record_Number, Q_Search_All.IA_Status_Narr, Q_Search_All.Site_Name WHERE Q_Search_All.Site_Name like *" & Me.SearchBox & "* FROM Q_Search_All ORDER BY [RFC_Number], [Version_Number]; "
But it finds no records, even though loads of sites exist where the letters exist. I'm guessing I havent written the syntax right in the sql statement around the like clause.... any ideas what I have done wrong?
Thanks
Gary