MS Access Autocorrect

J

jonwongfanclub

Hi. I was having some trouble with MS Access' Autocorrect. I
unchecked all the boxes in the Autocorrect options. I want to have one
of my fields prepend with 0s. Such as:

0012345
0056789
0011111
etc...

but MS Access continuously deletes the first two zeros in this field
and other fields. Any adivce? Thanks!
 
G

Graham Mandeno

This is nothing to do with autocorrect.

If your field is a numeric data type then the text that you enter is not
stored - only a binary representation of the number.

You have no control over how that number is stored, but you can control how
it is *displayed* by using the Format property of the field, or of any
textbox where the field is displayed on a form or report.

Set the Format property to 0000000 and you will get at least seven digits
with leading zeroes as necessary.
 
F

fredg

Hi. I was having some trouble with MS Access' Autocorrect. I
unchecked all the boxes in the Autocorrect options. I want to have one
of my fields prepend with 0s. Such as:

0012345
0056789
0011111
etc...

but MS Access continuously deletes the first two zeros in this field
and other fields. Any adivce? Thanks!

This has nothing to do with AutoCorrect.
If the field's datatype is Number, Access will not save leading zeros.
As a Number 0003 is exactly the same as 3.

If it's just a matter of display, set the Format property of the
control to as many zeros as you want the field to display numbers,
i.e. your example above would be
0000000

If the number values are not going to be used in any calculations,
then change the field datatype to Text.
Now Access will store leading zeros.
 
Top