G
Guest
Hi I am using a CutWord function in the following function:
_______________________________________________________________
Function DMSStrToDeg(ByVal DMS As String) As Double
'
' Converts a string value in the format [d m' s"] to a decimal number.
' Not all elements need be present, and they may contain decimal digits.
' e.g. 15 30' 0" -> 15.5
'
Dim i As Integer, w As String, Temp As Double
Temp = 0
For i = 1 To 3
w = CutWord(DMS, DMS)
Select Case Right(w, 1)
Case "'"
Temp = Temp + Val(w) / 60
Case """"
Temp = Temp + Val(w) / 3600
Case Else
Temp = Temp + Val(w)
End Select
Next i
DMSStrToDD = Temp
End Function
___________________________________________________
The error reads "Compile error: Sub or Function not defined"
I'm not sure why this is happening, since I took the code from a MS NEATCODE
example database. Is the CutWord function different in MS Access 2000 and
later versions? Thanks in advance for any guidance. Ruben.
_______________________________________________________________
Function DMSStrToDeg(ByVal DMS As String) As Double
'
' Converts a string value in the format [d m' s"] to a decimal number.
' Not all elements need be present, and they may contain decimal digits.
' e.g. 15 30' 0" -> 15.5
'
Dim i As Integer, w As String, Temp As Double
Temp = 0
For i = 1 To 3
w = CutWord(DMS, DMS)
Select Case Right(w, 1)
Case "'"
Temp = Temp + Val(w) / 60
Case """"
Temp = Temp + Val(w) / 3600
Case Else
Temp = Temp + Val(w)
End Select
Next i
DMSStrToDD = Temp
End Function
___________________________________________________
The error reads "Compile error: Sub or Function not defined"
I'm not sure why this is happening, since I took the code from a MS NEATCODE
example database. Is the CutWord function different in MS Access 2000 and
later versions? Thanks in advance for any guidance. Ruben.