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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to work around Run-time error '5854'? 2

Status
Not open for further replies.

gbent

Technical User
Jun 27, 2008
18
Good Afternoon,

I have a macro that is designed to complete processing for all files within a folder. However, the macro fails when it reaches a file called kern.rtf. The error message is Run-time error '5854'(String Parameter too long). In a previous post someone said that there is a 255 character limit for the fields. My macro separates data into COUNTY, NAME, DESCR, LOCATION, NRHP fiels. I believe that the problem is coming from the DESCR because some of the entries appear to be larger than 255 characters. Is there a way to work around this.

Any help would be truly appreciated.

Thank-you
gbent
 
Try using the 8.3 file name, there are a number of postings about getting the 8.3 file name.
 
I noticed one of your field names is DESCR. I don't think this is the cause, but I'll warn you not to change that name to DESC. VBA doesn't like it when you use reserved keywords. And DESC is the FIRST thing I thing when abbreviating description.

Tyrone Lumley
SoCalAccessPro
 
The 255 character limit applies to text fields, I would generally use a memo field for file names. One disadvantage is that a memo cannot be sorted, but there are work-arounds.
 
Thanks for your help everyone.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top