S
Shirley
Hi,
I'm trying to create a function to split up Ciy, State,
and Zip data from one field to 3 fields.
Here's the code:
If commapos <> 0 Then
city = Trim(Left$(address, commapos - 1))
length = Len(address)
'state = Right$(address, length - commapos)
state = Trim(Mid$(address, InStr(address, ",") + 1, 4))
zip = Trim(Right$(address, 5))
This code works if the state is in one word,
like "Florida", but not "New York"
Any suggestions?
Thanks
I'm trying to create a function to split up Ciy, State,
and Zip data from one field to 3 fields.
Here's the code:
If commapos <> 0 Then
city = Trim(Left$(address, commapos - 1))
length = Len(address)
'state = Right$(address, length - commapos)
state = Trim(Mid$(address, InStr(address, ",") + 1, 4))
zip = Trim(Right$(address, 5))
This code works if the state is in one word,
like "Florida", but not "New York"
Any suggestions?
Thanks