How do I call this function?

JPritch

Registered User.
Local time
Today, 05:52
Joined
Jan 7, 2005
Messages
54
I did some searching and found this function posted by someone in response to the exact same problem I'm now encountering.

But how do I call this in my query?

Function StripZeros(pstr As String) As String
Dim n As Integer

n = 1
Do While Mid(pstr, n, 1) = "0"
n = n + 1
Loop
n = IIf(n > 1, n, 1)
StripZeros = Mid(pstr, n)

End Function
 
JP,

Put the function in a Module on your Database window.

Make the function Public:

Public Function StripZeros(pstr As String) As String

Then, in a Query, add a new column:

NewField: StripZeros([pstr])

Then use NewField in any form, report or whatever.

Wayne
 
Thanks Wayne, works like a charm~!
 

Users who are viewing this thread

Back
Top Bottom