Please help! I am pulling what's left of my hair out on this one. I would like to open a form using an id from a combo box and a search term from a text box. When the user enters a search term into a text box and clicks "Search" button, they should get a resulting page that returns all records the combo box matches an ID and the text box searches in multiple other fields for the term. The ID and one search term parsing one column is the easy part. When I try and add more columns to the search term using the "Or" command it is not working right. See my code below. I know it is just a syntax issue, but can't figure it out.
This code gives me the result I am looking for where the first where clause is right and the description column is searched for the term in the search text box.
DoCmd.OpenForm "frmInventoryList", acNormal, "", "[KingdomID] = [Forms]![frmComponents2]![KingdomID] And [Description] Like '" & "*" & [Forms]![frmComponents2]![txtSearch] & "*" & "'"
What I need to do is have the first clause return as is and have multiple columns searched using the text box term. I thought the code below would work, but it returns everything.
DoCmd.OpenForm "frmInventoryList", acNormal, "", "[KingdomID] = [Forms]![frmComponents2]![KingdomID] And [Description] Like '" & "*" & [Forms]![frmComponents2]![txtSearch] & "*" & "' or [FamilyDescription] Like '" & "*" & [Forms]![frmComponents2]![txtSearch] & "*" & "'"
Thanks so very much for your help.