If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Remove leading 0's from Text field
I have a text field with leading zeros. Is there a way to
strip these off in Access 2000. thks Bruce |
#2
|
|||
|
|||
Remove leading 0's from Text field
Is the values in the field alphanumeric or just numeric?
-- Rob FMS Professional Solutions Group http://www.fmsinc.com/consulting Software Tools for .NET, SQL Server, Visual Basic & Access http://www.fmsinc.com -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- "Bruce" wrote in message ... I have a text field with leading zeros. Is there a way to strip these off in Access 2000. thks Bruce |
#3
|
|||
|
|||
Remove leading 0's from Text field
Field is Alph
-----Original Message----- Is the values in the field alphanumeric or just numeric? -- Rob FMS Professional Solutions Group http://www.fmsinc.com/consulting Software Tools for .NET, SQL Server, Visual Basic & Access http://www.fmsinc.com -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- "Bruce" wrote in message ... I have a text field with leading zeros. Is there a way to strip these off in Access 2000. thks Bruce . |
#4
|
|||
|
|||
Remove leading 0's from Text field
On Wed, 12 May 2004 10:45:20 -0700, "Bruce"
wrote: I have a text field with leading zeros. Is there a way to strip these off in Access 2000. thks Bruce One sneaky way: run an Update query updating the field to CStr(CLng([fieldname]). If the "numbers" have no decimal places and fewer than nine digits it should work fine. More tedious but more general: write a VBA function such as Public Function StripZero(strIn As String) As String Dim iPos As Integer StripZero = "" For iPos = 1 to Len(strIn) If Mid(strIn, iPos, 1) 0 Then StripZero = Mid(strIn, iPos) Exit Function End If Next iPos End Function and update the field to StripZero([fieldname]). John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
Thread Tools | |
Display Modes | |
|
|