Thank you for your reply.
I was referring to any query, rather than a specific query, and I was
hoping
for a hotfix, rather than a code fix. I am using a UDF at the moment to
deal
with the problem, but it is tedious, because the computer on which the
database is to be used allows Replace in a query.
Here is an example of using Replace, and it does not work:
'========================================
strSQL = "SELECT Format(Nz(Member,False),'Yes/No') As
Mem,Title,Forename,Surname,InvoiceNumber,InvoiceTo," _
& "Replace(InvoiceToAddress,(Chr(13)+Chr(10)),'<BR>') As
Address,Amount,InvoiceDate,PaidDate,AuthDate,PrintDate FROM tmpAnalysis
WHERE
" _
& Me.Filter
'========================================
However, if I change Replace to refer to this UDF all is well:
'========================================
Function FindAndReplace(ByVal strInString As String, _
strFindString As String, _
strReplaceString As String) As String
FindAndReplace = Trim(Replace(strInString & " ", strFindString, _
strReplaceString))
End Function
'========================================
As you can appreciate, Replace is a very useful function in queries, and I
would prefer not to have to add a UDF to every new DB.