GETTING RID OF AMPERSAND (&) IN TEXTFLD

Rich_Lovina

Registered User.
Local time
Today, 23:53
Joined
Feb 27, 2002
Messages
225
I have an INITIALS FIELD such that AB&CD Smith are couples. What is the expression to queryupdate COUPLES field to yes. Ive done this before but forgotten the expression.
I can filter to replace all & with +, and then use my initials splitter.Any ideas? Thanks in advance...SQL learner.
 
Here is a function I quickly wrote that can be called from an Update Query to do what you ask:

Public Function fReplaceAmpersands(strEntry As Variant) As String
Dim strTemp As String
Dim x As Integer
If IsNull(strEntry) Then Exit Function
For x = 1 To Len(strEntry)
&nbsp If Mid$(strEntry, x, 1) = "&" Then
&nbsp &nbsp strTemp = strTemp & "+"
&nbsp Else
&nbsp &nbsp strTemp = strTemp & Mid$(strEntry, x, 1)
&nbsp End If
Next x
fReplaceAmpersands = strTemp
End Function

HTH
RDH

[This message has been edited by R. Hicks (edited 09-02-2001).]
 

Users who are viewing this thread

Back
Top Bottom