field lengths

S

svetelina

My question is about customising field lengths. I would
like to import data into intiger field, but restrict the
length of the field to 4 characters long. By default the
integer field is six characters long.
I need to export the integer fields into fixed width
format and my interer fields cannot be more the 4 chars
long.
Is there a way to customise lenght of integer fields?
 
D

Douglas J. Steele

To export, create a query with something like Right$(" " &
CStr([MyNumber]), 4) instead of MyNumber itself.
 
J

John Nurick

Hi Svetelina,

Access's integer field type is stored as a two-byte binary value, and
the space the field occupies is the same regardless of the number it
contains, so customising the length is not an option.

You could restrict the values that can be stored in the field to those
that can be represented in a four-character string when exported, namely
-999 to 9999
by setting a validation rule on the field, e.g.
= -999 And <= 9999




My question is about customising field lengths. I would
like to import data into intiger field, but restrict the
length of the field to 4 characters long. By default the
integer field is six characters long.
I need to export the integer fields into fixed width
format and my interer fields cannot be more the 4 chars
long.
Is there a way to customise lenght of integer fields?

John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Top