Try using msgbox's at the critical portions of the code to determine that the values are right. The reason I say this, is because it's been my experience that VB's IDE doesn't do a very good job of changing variable values in the IDE. So, for example, you could do this:
ublic 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
msgbox "starting loop"
For i = 1 To Len(flname)
msgbox "at first if"
If Mid(flname, i, 2) = "//" Then GoTo skipnext
msgbox "value is: " & mid(flname, i, 2)
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:
msgbox "at skip next"
Next i
Getareaname = fName
You can add and remove msgbox's as necessary to help trace variables through your code, and figure out where it's going wrong. If you could attach a copy of the file you are passing to this function (or an example of it) then I can try to trace it myself, but since I don't know the layout inside of the file, it makes testing your function a little more difficult.