D
DB via AccessMonster.com
I am trying to use Like to find said field that contains the words "order"
and "to". I have tried several variations of the below. The SQL executes as
the first example in a query but when I put it into VBA and try to set it as
the recordsource to a form I get Compile Error: sytax error. I have seen in
various posts that you have to concat the wildcards as strings but I don't
beleive that applies in my case since the wildcards are a part of the string.
I tried a variation of concating the wildcards anyway in option 2.
1. Like "*TO*" And (tblHouse.[Consignee Client Name]) Like "*ORDER*"
2. Like "*" & "TO" & "*" And (tblHouse.[Consignee Client Name]) Like "*" &
"ORDER" & "*"
Here is the whole recordsource SQL statement.
Me.RecordSource = "SELECT tblHouseFinalScriptInfo.FileNumber, tblHouse.
[Consignee Client Name]" & _
"FROM tblHouseFinalScriptInfo LEFT JOIN tblHouse ON tblHouseFinalScriptInfo.
FileNumber = tblHouse.[File Number]" & _
"GROUP BY tblHouseFinalScriptInfo.FileNumber, tblHouse.[Consignee Client Name]
, tblHouseFinalScriptInfo.RevClientNo, tblHouseFinalScriptInfo.BillClientNo,
tblHouseFinalScriptInfo.ConClientNo" & _
"HAVING (((tblHouse.[Consignee Client Name]) Like "*" & "TO" & "*" And
(tblHouse.[Consignee Client Name]) Like "*" & "ORDER" & "*") AND (
(tblHouseFinalScriptInfo.RevClientNo) Is Null) AND ((tblHouseFinalScriptInfo.
BillClientNo) Is Null) AND ((tblHouseFinalScriptInfo.ConClientNo) Is Null));"
Any help would be greatly appreciated. Thank You.
and "to". I have tried several variations of the below. The SQL executes as
the first example in a query but when I put it into VBA and try to set it as
the recordsource to a form I get Compile Error: sytax error. I have seen in
various posts that you have to concat the wildcards as strings but I don't
beleive that applies in my case since the wildcards are a part of the string.
I tried a variation of concating the wildcards anyway in option 2.
1. Like "*TO*" And (tblHouse.[Consignee Client Name]) Like "*ORDER*"
2. Like "*" & "TO" & "*" And (tblHouse.[Consignee Client Name]) Like "*" &
"ORDER" & "*"
Here is the whole recordsource SQL statement.
Me.RecordSource = "SELECT tblHouseFinalScriptInfo.FileNumber, tblHouse.
[Consignee Client Name]" & _
"FROM tblHouseFinalScriptInfo LEFT JOIN tblHouse ON tblHouseFinalScriptInfo.
FileNumber = tblHouse.[File Number]" & _
"GROUP BY tblHouseFinalScriptInfo.FileNumber, tblHouse.[Consignee Client Name]
, tblHouseFinalScriptInfo.RevClientNo, tblHouseFinalScriptInfo.BillClientNo,
tblHouseFinalScriptInfo.ConClientNo" & _
"HAVING (((tblHouse.[Consignee Client Name]) Like "*" & "TO" & "*" And
(tblHouse.[Consignee Client Name]) Like "*" & "ORDER" & "*") AND (
(tblHouseFinalScriptInfo.RevClientNo) Is Null) AND ((tblHouseFinalScriptInfo.
BillClientNo) Is Null) AND ((tblHouseFinalScriptInfo.ConClientNo) Is Null));"
Any help would be greatly appreciated. Thank You.