ClaraBarton
Registered User.
- Local time
- Yesterday, 16:38
- Joined
- Oct 14, 2019
- Messages
- 661
Code:
sql = "SELECT qryRecipe.recipeID, t_recipeingredient.ingredienttext AS Ingredient, " _
& "qryRecipe.recipename, qryRecipe.t_cookbook.name AS cookbook, " _
& "qryRecipe.t_cookbookchapter.name AS chapter, qryRecipe.createdate, " _
& "qryRecipe.source, qryRecipe.author " _
& "FROM qryRecipe LEFT JOIN t_recipeingredient ON qryRecipe.recipeID = t_recipeingredient.recipeid " _
& "WHERE (((t_recipeingredient.ingredienttext) Like " * " & [Forms]![frmSearch]![ingredient] & " * ") " _
& "AND ((qryRecipe.recipename) Like " * " & [Forms]![frmSearch]![recipename] & " * ") " _
& "AND ((qryRecipe.t_cookbook.name) Like " * " & [Forms]![frmSearch]![cookbook] & " * ") " _
& "AND ((qryRecipe.t_cookbookchapter.name) Like " * " & [Forms]![frmSearch]![chapter] & " * ") " _
& "AND ((qryRecipe.createdate) Like " * " & [Forms]![frmSearch]![createdate] & " * ") " _
& "AND ((qryRecipe.source) Like " * " & [Forms]![frmSearch]![source] & " * ") " _
& "AND ((qryRecipe.author) Like " * " & [Forms]![frmSearch]![author] & " * "))"
This above sql statement will not work unless I remove the spaces between the " and the *
i.e. "*" and not " * ".
But every time I change all of them, Access puts them back. Auto correct or something. How do I fix this?