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!

field length question

Status
Not open for further replies.

DBrack

MIS
Mar 12, 2004
33
US
Hello All,

One of the fields in a table is 11 characters in length. Would access raise on error usually or truncate the input if an input string of length > 11 is inserted? In this case, access just chopped off the remaining characters without a warning causing data loss. Any comments? Thanks.
 
If you're entering data directly into the table, you will not be able to enter any more than 11 characters in your field.

If you're using a data entry form to input the data, the field on the form should not allow more than 11 characters.
 
I find that in my version (2000), Access responds "The text is too long to be edited" when I try to paste a string that is too long for the field in both forms and tables. If a set of records is pasted into a table, the 'bad' records are noted in a paste errors table.
 
Hello All,

The data is not entered through a form. The data displays on a list box that has several columns. Text from Column(0) gets inserted into the field in the database.

So, I assume no errors appear when data is inserted like this.

Thanks.

 
Hello,

The list box control exists on a form. The form uses a query to pull the data from the database and displays all the resulting rows on the list box. The list box has columns defined in its "Column Widths" fields. Column(0) is the first field in the query.





 
You may consider the Left function in the SQL code of your ListBox's Rowsource.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hello again.

Any row can be selected using the mouse in the list box display. After selecting a row, clicking the "Register" button will retrieve column(0) value and insert it into another table. At this point, Access is not returning an error if the length is greater than the field length in table.

PHV, Problem is column(0) is dynamic in length... It could be 17 or 18 chars long.
 
But you said you wanted only 11 ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Do you have any control over modifying the table structure? Seems to me it would make sense for the field that you're inserting into should match (datatype and size) the source field for your column(0).
 
PHV, Sorry. it is actually 10 or 11 chars long.

Whast I was asking is ... why didn't access raise an error when a string of larger length was inserted instead of chopping the text and causing confusion and data loss.

Thanks everyone...
 
Hello.. To answer your question: The fild in the database is "Text". The list box was created from the tools box.. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top