Undefined function in expression

  • Thread starter Thread starter JohnD
  • Start date Start date
J

JohnD

I am running the following query with the MungPart function. I have shown
the query then the function. I do not understand why it keeps coming back
with an error, so any help from fresh eyse would be appreciated. All this is
supposed to so is take out the garbage from the Sheet1.grainger1 field and
place the clean data in sheet1.grainger2 field.

SELECT Sheet1.proto, Sheet1.grainger1, Sheet1.flag, Sheet1.grainger2
FROM Sheet1
WHERE (((Sheet1.grainger2)=MungPart([grainger1])));


Function Mungpart(strPart As String) As String
Dim i As Integer
Dim StrChar As String
Dim StrTemp As String
For i = 1 To Len(strPart)
StrChar = Mid$(strPart, i, 1)
Select Case StrChar
Case " "
Case "_"
Case "-"
Case "."
Case Else
StrTemp = StrTemp & StrChar
End Select
Next i
Mungpart = StrTemp
End 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

Back
Top