strSQL = "SELECT *From Product"
strWhere = " WHERE (((Products.TagNumber) Like Me!TagSearch)) AND ((Products.CategoryID)=Me!CategorySearch));"
strSQL = strSQL & strWhere
Me!SearchResult.RowSourceType = "Table/Query"
Me!SearchResult.RowSource = strSQL
Me!SearchResult.Requery
I am trying to incorporate a search button that displays the result in the display box <SearchResult>. I can make the form work just fine using a query form and incorporating that into my form. However, I want to learn more than that to create more advance features in my search form. I am trying to use the code above in the OnClick event of my search button. But, the results are not coming up. Is my code wrong? (Up there I am searching by TagNumber and CategoryID)
Please help!
Thanks!
strWhere = " WHERE (((Products.TagNumber) Like Me!TagSearch)) AND ((Products.CategoryID)=Me!CategorySearch));"
strSQL = strSQL & strWhere
Me!SearchResult.RowSourceType = "Table/Query"
Me!SearchResult.RowSource = strSQL
Me!SearchResult.Requery
I am trying to incorporate a search button that displays the result in the display box <SearchResult>. I can make the form work just fine using a query form and incorporating that into my form. However, I want to learn more than that to create more advance features in my search form. I am trying to use the code above in the OnClick event of my search button. But, the results are not coming up. Is my code wrong? (Up there I am searching by TagNumber and CategoryID)
Please help!
Thanks!