G
Guest
I'm wondering if you can use multiple criteria in a FindFirst statement. I
created a query to select by CutomerID and Customer Address and took the
SELECT statement and tried to adapt it to the FindFirst statement which I
thought allowed you to use a SELECT statement without the WHERE. However, I
have not been able to make the end strStringSearch look like the one in the
SELECT statement. According to the query the WHERE part of the query I
created was
(((tblFamilyMembers.CustomerID)=9)AND((tblFamilyMembers.CustomerAddress)="124 First Avenue"))
I've tried all several different ways to try to duplicate the above but
haven't been able to. Is it possible? Also, should I use brackets or
parenthesis for the table names? This is my last attempt.
strStringSearch = "(([CustomerID]=" & Me!CustomerID & ")" & "AND" & _
"([CustomerAddres]=)" & Me!CustomerAddress & "))"
rs.FindFirst strStringSearch
The error I get, most of the time, is 3077 - 'missing operator', but it
looks like the parenthesis and the quotes are paired up right. Another
problem seems to be that I need quotes around the CustomerAddress as is in
the WHERE statement, but when I try to put those in instead of the actual
CustomerAddress, i.e. 123 First St., I get Me!CustomerAddress. Any help is
greatly appreciated as has been all the other help that has been offered to
other questions I have posted. This discussion group has helped immensely in
wading through Access and VBA. Thank you all so much for your continuing help
and patience.
Randy M
created a query to select by CutomerID and Customer Address and took the
SELECT statement and tried to adapt it to the FindFirst statement which I
thought allowed you to use a SELECT statement without the WHERE. However, I
have not been able to make the end strStringSearch look like the one in the
SELECT statement. According to the query the WHERE part of the query I
created was
(((tblFamilyMembers.CustomerID)=9)AND((tblFamilyMembers.CustomerAddress)="124 First Avenue"))
I've tried all several different ways to try to duplicate the above but
haven't been able to. Is it possible? Also, should I use brackets or
parenthesis for the table names? This is my last attempt.
strStringSearch = "(([CustomerID]=" & Me!CustomerID & ")" & "AND" & _
"([CustomerAddres]=)" & Me!CustomerAddress & "))"
rs.FindFirst strStringSearch
The error I get, most of the time, is 3077 - 'missing operator', but it
looks like the parenthesis and the quotes are paired up right. Another
problem seems to be that I need quotes around the CustomerAddress as is in
the WHERE statement, but when I try to put those in instead of the actual
CustomerAddress, i.e. 123 First St., I get Me!CustomerAddress. Any help is
greatly appreciated as has been all the other help that has been offered to
other questions I have posted. This discussion group has helped immensely in
wading through Access and VBA. Thank you all so much for your continuing help
and patience.
Randy M