Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Frederick, Maryland, USA
    Posts
    296
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Remove Leading Zeros (A2K SR1)

    How do I strip the leading zeros from data entered into a form field? Despite my best efforts, my users continue to add leading zeros to a particular field, which screws up the processing of subsequent reports. The field only ever contains a number, so I can make the field either Text or Numeric. Any and all suggestions would be greatly appreciated. Thanks and Happy New Year to everyone!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Remove Leading Zeros (A2K SR1)

    If you make the field into a numeric field, only the numeric value will be stored, not the leading zeros entered by the user. An additional advantage of using a text field is that non-numeric values won't be accepted by Access.

    If you prefer a text field, you could use Val([FieldName]) to get the numeric value. To ensure numeric data entry, you can set the Format property to a built-in or custom numeric format.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •