P
Peter
I have asked the following question a number of days
before:
In an Access 97 database, we get a field containing data
like 23/2001, 367/2001, 12/2002, 3/2005.
There is a request to change the display as
BB2001/23
BB2001/367
BB2002/12
BB2005/3
Naresh MVP has suggested an VBA module. Thank you for
your advice.
However, I have created a simple Function as follow and it
works for most of the time:
Function ExtractS(x) As String
Dim i, j, k As Integer
If IsNull(x) Then
Exit Function
Else
ExtractS = Right(x, (Len(x) - (InStr(x, "/")))) & "/"
& Left(x, InStr(x, "/") - 1)
End If
End Function
However, I find that it gives me an error when there is
there is record with "/".
Is there any suggestion to improve the function ?
Thanks
before:
In an Access 97 database, we get a field containing data
like 23/2001, 367/2001, 12/2002, 3/2005.
There is a request to change the display as
BB2001/23
BB2001/367
BB2002/12
BB2005/3
Naresh MVP has suggested an VBA module. Thank you for
your advice.
However, I have created a simple Function as follow and it
works for most of the time:
Function ExtractS(x) As String
Dim i, j, k As Integer
If IsNull(x) Then
Exit Function
Else
ExtractS = Right(x, (Len(x) - (InStr(x, "/")))) & "/"
& Left(x, InStr(x, "/") - 1)
End If
End Function
However, I find that it gives me an error when there is
there is record with "/".
Is there any suggestion to improve the function ?
Thanks