I am practicing VBA for Access 2010.
I read all the suggested post regarding my post but did not find anything specific.
I know how to move specific characters in a string, what I do not know is how I can remove specific character that equals to something.
I want to move the character 1 or 1- from telephone numbers if one is there.
Example: 17188888888 to 7188888888 or 1-7188888888 to 7188888888
I am trying to use an if statement starting first with just removing the 1.
The phone number is entered as a string not numbers.
This is what I have started: I am getting an error message that RemoveFirstChar is ambiguous.
Public Function RemoveFirstChar(RemFstChar As String) As String
If Left(RemFstChar, 1) = "1" Then
RemFstChar = Replace(RemFstChar, "1", "")
End If
RemoveFirstChar = RemFstChar
End Function
I have tested your function in Access 2010 and it worked just fune.. You can also use this code: