I've created the following series of If statements that are totally disfunctional. I'm thinking it has to do with my lack of understanding between a function and a statement. (I'm an old mainframe programmer and sometimes have difficulties crossing over)
Even though when I do a watch on the fields, the values are what I expect, the if statement doesn't perform the Then... and the Else on the 3rd errors out.
Here's the code I'm trying to get working:
Public Function Getareaname(flname As String) As String Dim fposn As Long, i As Integer Dim fName As String Dim tmpname As String fName = "d:\getarea" fposn = 11 For i = 1 To Len(flname) If Mid(flname, i, 2) = "//" Then GoTo skipnext If Mid(flname, i, 2) = "u:" Then GoTo skiplev If Mid(flname, i, 1) = "/" Then Mid(fName, fposn, 1) = "\" Else: Mid(fName, fposn, 1) = Mid(flname, i) fposn = fposn + 1 skipnext: Next i Getareaname = fName