Access expression

S

sam

I would like to know how to write an expression where I
take the last name and the first name and combine them
together with the Apostrophe example:

O'neile,a it should be coming as Oneilea.

Thank you
 
I

Immanuel Sibero

Hi
Try this function below. Copy and paste the function to a module.


HTH,
Immanuel Sibero





Function fExtractSpecStr(ByVal strInString As String) As String

Dim lngLen As Long
Dim strOut As String
Dim intCount As Long, strTmp As String

lngLen = Len(strInString)
strOut = ""
For intCount = 1 To lngLen
strTmp = Left$(strInString, 1)
strInString = Right$(strInString, lngLen - intCount)
'The next statement will extract special chars
If (Asc(strTmp) >= 48 And Asc(strTmp) <= 57) Or _
(Asc(strTmp) >= 65 And Asc(strTmp) <= 90) Or _
(Asc(strTmp) >= 97 And Asc(strTmp) <= 122) Then

strOut = strOut & strTmp
End If
Next intCount

fExtractSpecStr = strOut

End Function
 
D

desiree figueroa

sam said:
I would like to know how to write an expression where I
take the last name and the first name and combine them
together with the Apostrophe example:

O'neile,a it should be coming as Oneilea.

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top