I've read through hundreds of questions and answers, but I just can't seem to get this to work. I'm attempting to use this SQL statement to set the rowsource for a listbox...
If searchOpt = 1 Then
sqlStr = "SELECT tblEquipment.anumEquipID," & _
" tblEquipment.strPCN," & _
" tblEquipment.strDescription," & _
" tblEquipment.strOwnerDepartment," & _
" tblEquipment.strPrimaryID," & _
" tblEquipment.strSecondaryID," & _
" tblEquipment.strNote," & _
" tblEquipment.ynCapitalItem," & _
" tblEquipment.strLocation," & _
" tblContacts.strPrimaryContact," & _
" tblContacts.strPrimaryPhone" & _
" FROM tblContacts RIGHT JOIN tblEquipment ON tblContacts.anumID = tblEquipment.strPrimaryID" & _
" WHERE (((tblEquipment.strDescription) Like " * " & [Forms]![frmSearch]![strSearchBox] & " * "));"
I keep getting a "type Mismatch" error using the above. I've tried changing the quotes and changing the * to %, where I either get a "Syntax" error or no error but the listbox does not populate. By the way this code is tied to a button that is pressed to search the text of a data field "strDescription" using an unbound text box on the form.
I would really appreciate any help you can offer. Thanks