Re: Repace function in a query
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Mon, 5 Dec 2005 13:05:34 -0500
What version of Access? Access 2000 has the Replace function, but it
doesn't work in queries as the expression service does not recognize it.
I'm not sure, but I think it was patched in one of the updates to Access
2000.
You can use a wrapper function to make it work.
Code from Dirk Goldgar, MS Access MVP
'---- start of code ----
Function fncReplace(strExpression As String, _
strFind As String, _
strReplace As String, _
Optional lngStart As Long = 1, _
Optional lngCount As Long = -1, _
Optional lngCompare As Long = vbBinaryCompare) _
As String
fncReplace = Replace(strExpression, strFind, strReplace, _
lngStart, lngCount, lngCompare)
End Function
'---- end of code ----
www.datagnostics.com
"Jeff Boyce" <nonsense@xxxxxxxxxxxx> wrote in message
news:eRi88Rc%23FHA.912@xxxxxxxxxxxxxxxxxxxxxxx
> How? We're not there, so we can't see how you are trying "to use the
> Replace function in a query". Can you post the SQL statement for the
> query?
>
> Are you certain there are no References marked as MISSING in your
> database?
>
> Regards
>
> Jeff Boyce
> <Office/Access MVP>
>
> "franky" <franky@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:E412037B-9276-44EE-BD7B-51291DB807D3@xxxxxxxxxxxxxxxx
>> Hello,
>>
>> I'm attempting to use the Replace function in a query and get a "Function
>> Undefined" error when running query. However, the Replace function is
>> working fine in a module and debug window in the same database.
>>
>> I have some text fields with double quotes in them (ie: like "this") and
>> I
>> wanted to replace them with single quotes. I cant seem to pass these
>> values
>> to a function because I get a "Expected: list separator or )" error
>> because
>> of the double quotes in the string. Any suggestions?
>>
>> Thanks in advance
>
>
.
- Follow-Ups:
- Re: Repace function in a query
- From: franky
- Re: Repace function in a query
- References:
- Re: Repace function in a query
- From: Jeff Boyce
- Re: Repace function in a query
- Prev by Date: Re: Repace function in a query
- Next by Date: Re: Treat table data as formula in a query?
- Previous by thread: Re: Repace function in a query
- Next by thread: Re: Repace function in a query
- Index(es):
Relevant Pages
|