|
Custom Search
| |
|
Solved: MS Access error "The text is too long to be edited"
In this article, we're going to look at how to resolve a common Text Box limitation issue on a MS Access form - the number of characters is too large to be added to the box, and as a result of this, the text can't be saved to a table. Problem explained Below is the error message that popped up automatically when I pasted a large amount of text into an Access Text Box control. "The text is too long to be edited."
The root cause of this error is: Normally a Text Box control is used for viewing, editing, or entering data via user interface (e.g. Access form). If used for entering data through a user interface, the data are normally typed or pasted to the Text Box control and then saved to a Short Text field or Long Text field (used to be called Memo field before 2013) in a table (please note other types of field also can be used). In this case, the following 2 scenarios can happen.
According to Microsoft, if data are not entered through user interface but entered programmatically via VBA, 1 gigabyte of characters can be saved to Long Text field. Resolving the issue Here we focus on resolving issue presented with the second scenario above. It's not uncommon we need to save large amount of text which is more than 65,535 characters to a Long Text field in a table. Our solution is to save the text to two (or more) Long Text fields in the table via VBA. In this case, we need to create two (or more) Text Box controls in a form, then split the text into two (or more) chunks. Text in the first Text Box control is saved to the first Long Text field and Text in the second Text Box control is saved to the second Long Text field. When the text is to be used, extract them from the two Long Text fields, then concatenate them into one single piece of text. In my project, I had to manually save a web page's large amount of HTML source code to Access and in some cases the size could be over 65,535 characters (including spaces). I created the form below as a work around to bypass the 65,535 characters system limitation of Access.
Here is the table design of the HTML_SOURCE table.
Data in 'HTML Source Part 1' is saved to Source1 field and Data in 'HTML Source Part 2' is saved to Source2 field.
Happy Coding! |
Copyright © 2024 GeeksEngine.com. All Rights Reserved. This website is hosted by HostGator. No portion may be reproduced without my written permission. Software and hardware names mentioned on this site are registered trademarks of their respective companies. Should any right be infringed, it is totally unintentional. Drop me an email and I will promptly and gladly rectify it. |
Home | Feedback | Terms of Use | Privacy Policy |