fischadler
Programmer
Please take a look at the query below:
SELECT CustomerID, LastName, FirstName, Phone1, Phone2, Mobile, Email
From Customers
Where (((Replace([Customers]![Phone1], " ", "")) Like "*5567*")) Or (((Replace([Customers]![Phone2], " ", "")) Like "*5567*")) Or (((Replace([Customers]![Mobile], " ", "")) Like "*5567*")) ORDER BY CustomerID;
Note that this query works fine MS Access. However if I try to get a recordset using:
Set rstCustomers = MyDB.OpenRecordset(strSQL)
Where strSQL is the query above, I get a Visual Basic rubtime error 3085 reading "Undifined function 'Replace' in expression."
Any ideas?
SELECT CustomerID, LastName, FirstName, Phone1, Phone2, Mobile, Email
From Customers
Where (((Replace([Customers]![Phone1], " ", "")) Like "*5567*")) Or (((Replace([Customers]![Phone2], " ", "")) Like "*5567*")) Or (((Replace([Customers]![Mobile], " ", "")) Like "*5567*")) ORDER BY CustomerID;
Note that this query works fine MS Access. However if I try to get a recordset using:
Set rstCustomers = MyDB.OpenRecordset(strSQL)
Where strSQL is the query above, I get a Visual Basic rubtime error 3085 reading "Undifined function 'Replace' in expression."
Any ideas?