H
Hanif Merali
Hello I'm trying to use a custom function that I've writtin within an
update query. The function takes in a string as a parameter and
ouputs a string. I saved the function in a module called Formatting.
When I open the update query in design view and fill in all the update
to field with
FormatUnitNum([fieldname]) it says function does not exist. Am I
supposed to save the function somewhere else or call the module
somethign else?
Here is what the code looks like
Public Function FormatUnitNum(strAddress As String) As String
Dim strTokens As Variant
Dim numTokens As Integer
Dim output As String
strTokens = Split(strAddress, " ")
numTokens = UBound(strTokens)
output = strTokens(numTokens) + "-"
For i% = 1 To numTokens - 1
output = ouput + " " + strTokens(j%)
End Sub
FormatUnitNum = output
Return
End Function
Thanks in advance for your help.
Sincerly,
H.M.
update query. The function takes in a string as a parameter and
ouputs a string. I saved the function in a module called Formatting.
When I open the update query in design view and fill in all the update
to field with
FormatUnitNum([fieldname]) it says function does not exist. Am I
supposed to save the function somewhere else or call the module
somethign else?
Here is what the code looks like
Public Function FormatUnitNum(strAddress As String) As String
Dim strTokens As Variant
Dim numTokens As Integer
Dim output As String
strTokens = Split(strAddress, " ")
numTokens = UBound(strTokens)
output = strTokens(numTokens) + "-"
For i% = 1 To numTokens - 1
output = ouput + " " + strTokens(j%)
End Sub
FormatUnitNum = output
Return
End Function
Thanks in advance for your help.
Sincerly,
H.M.