Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why not set text fields to 255?

Status
Not open for further replies.

grnzbra

Programmer
Mar 12, 2002
1,273
US
My understanding is that if a three or four or whatever length string is entered into a text field in a table, it only takes up the space of the lenght of the string, not the amount of space that has been allotted to the field. If this is the case, why not just set all text fields to 255 to avoid the unexpectedly long entry from causing problems? Is there a downside to this?
 
grnzbra,

According to Access help, "You should use the smallest possible FieldSize property setting because smaller data sizes can be processed faster and require less memory."

Although I too am not sure how memory size is actually managed internally with Access, this property has the added benefit of programmatically limiting the size of text that can be entered: Why would a user need more than two characters to enter the abbreviation for a state? So don't let them. Things of this nature.

Hope this helps,

Tom
 
There are other practical considerations. For example, if you want to print out addresses onto labels that are 40 characters wide and you allow address lines to be 255 characters you are likely to print out incomplete labels either because the line gets truncated or the line wraps and you run out of rows on the label. Generally report design is made more difficult if the field size is not limited to what is practical.
 
grnzbra, you are correct with regards to what is saved, but as you seem to suspect, there are some downsides, see for instance CajunCenturion's reply here thread700-738563 (interesting discussion on the topic)

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top