CutWord function causing compile error?

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.
 
G

Guest

I resolved my problem. I needed to reference the CutWord function in my
code. I didn't realized that CutWord wasn't a built-in function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top