Function
StandortAusTransferGrp(TransferGrp
As
String
)
As
String
Dim
strSTG
As
String
Dim
chrPos
As
Long
Dim
chrLen
As
Long
Dim
lngStart
As
Long
strSTG = DLookup(
"[Standort]"
,
"[TransferGrp_Standort_tbl]"
,
"[TRANSFER_GRP]='"
& TransferGrp &
"'"
)
chrLen = Len(strSTG)
lngStart = 1
Do
For
chrPos = lngStart
To
chrLen
Select
Case
Mid(strSTG, chrPos, 1)
Case
0
To
9
Case
Else
If
chrPos = 1
Then
strSTG = Right(strSTG, Len(strSTG) - 1)
lngStart = chrPos
chrLen = Len(strSTG)
Exit
For
ElseIf
chrPos = chrLen
Then
strSTG = Left(strSTG, Len(strSTG) - 1)
Exit
Do
Else
strSTG = Left(strSTG, chrPos - 1) & Right(strSTG, Len(strSTG) - chrPos)
lngStart = chrPos
chrLen = Len(strSTG)
Exit
For
End
If
End
Select
Next
chrPos
Loop
StandortAusTransferGrp = strSTG
End
Function