I am currently working on a search feature for a database. What I have is a text box for entering a phrase and then a combo box for picking where to search.
Right now I'm not too concerned about getting the combo box to work, all I want is to have it so that when I pick Author in the combo box, it will search for an author. The values from the combo box are stored in the variable txtSearchType1 and the values from the text box are stored in txtSearchString1. I can use the information in the text box, but I am having trouble using the information from the combo box.
Here is what I have in code:
SELECT DISTINCTROW LIBRARY.NAME, LIBRARY.TYPE
FROM LIBRARY
WHERE (([Forms]![search]![txtSearchType1]) LIKE "*" & [Forms]![search]![txtSearchString1] & "*")
ORDER BY LIB.N1;
If I change the "[Forms]![search]![txtSearchType1]" part to LIBRARY.AUTHOR it works, but I don't know how to use it so that it uses the value from the combo box. Any help would be appreciated.
Thanks,
Tim
Right now I'm not too concerned about getting the combo box to work, all I want is to have it so that when I pick Author in the combo box, it will search for an author. The values from the combo box are stored in the variable txtSearchType1 and the values from the text box are stored in txtSearchString1. I can use the information in the text box, but I am having trouble using the information from the combo box.
Here is what I have in code:
SELECT DISTINCTROW LIBRARY.NAME, LIBRARY.TYPE
FROM LIBRARY
WHERE (([Forms]![search]![txtSearchType1]) LIKE "*" & [Forms]![search]![txtSearchString1] & "*")
ORDER BY LIB.N1;
If I change the "[Forms]![search]![txtSearchType1]" part to LIBRARY.AUTHOR it works, but I don't know how to use it so that it uses the value from the combo box. Any help would be appreciated.
Thanks,
Tim