Skip to content

Writing Long Strings to an InputBox

How to write long strings to an InputBox.

Q:  Peter Matthews writes that help for the InputBox says it will input the user’s string, and the definition of a (variable length) string says it can be up to 2 billion characters. So how come my VBA called out InputBox won’t accept more than 256 characters?

A:  Microsoft does have a history of not checking to see that various aspects of a feature match up (presumably because they were developed by different groups).  Word doc properties can hold up to 255 characters, for example, but the Word DocProperty field that displays a doc property on a Word document can only display 127 characters.

I think you would be much better off with a popup form with a textbox bound to a Memo field, as it would be awkward working with very large amounts of text in an InputBox.  Write the data to the textbox, then let the user edit it, and put it into the file from there.  I usually have a one-record table called tblInfo in my databases, to hold miscellaneous information that can be used throughout the database.  This is where I would put the field.  It would be easier to view and edit the text that way, especially if it is large.


You could also use an unbound textbox for this purpose, but I like to save this type of info to a table, both so it will be preserved indefinitely, and so I can save and retrieve data to it in code, regardless of whether or not the form is open.

About this author

Office 2024 - all you need to know. Facts & prices for the new Microsoft Office. Do you need it?

Microsoft Office upcoming support end date checklist.