Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

undefined function error in query

Status
Not open for further replies.

patrichek

MIS
Nov 18, 2003
632
US
Hi All,
i borrowed and slightly modified one of PHV's functions and now I can't get it to run in an update query.

Here's the code for the function:

Code:
Public Function getPhoneNum(strPhone)
Dim i As Integer, x As String, s As String
If Len(Trim(Nz(strPhone, ""))) = 0 Then Exit Function
For i = 1 To Len(strPhone)
  x = Mid(strPhone, i, 1)
  If IsNumeric(x) Then s = s & x
Next i
getPhoneNum = Format(s, "##########")
End Function

here is my query sql:
Code:
UPDATE Contacts SET Contacts.WorkPhone = getPhoneNum([WorkPhone]);
I'm getting "undefined function 'getPhoneNum' in query" error. I've checked the references in vb and i have none missing.
Any help would be appreciated.

thanks!
 
ok, nevermind. I figured it out. I had named the module 'getPhoneNum' which you can't do.

thanks PHV ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top