Importing data from Word forms. Error: Field is too small to accept etc.BUT IT ISN'T! (1 Viewer)

whitespace

Registered User.
Local time
Today, 02:13
Joined
Aug 30, 2005
Messages
51
Hello all, I've written code using the examples given at http://msdn.microsoft.com/en-us/library/aa155434(office.10).aspx to import data into Access from Word via word forms.

I've generated a template with data and when I tried dummy data this imported fine, but the templates have now been distributed and returned and in the third import field I'm getting the following VB error:

"Run-Time error '-2147217887 (80040e21)': The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data."

In the line (in bold):

Code:
With rst
    .AddNew
    !SII = doc.FormFields("SII").Result
    !Team = doc.FormFields("Team").Result
[B]    !TeamFocus = doc.FormFields("TeamFocus").Result[/B]

This in iteslf would seem fairly easy to sort, but I still get this error even when I've changed the text field (in Access) to allow for the characters, I've also changed it to Memo but get the same error. The field in question contains the following data:

Code:
Support for schools causing concern
Summative attainment & attitude data
Support for schools in systems/software

Which clearly is less than 255 chars.

The field this is going in to is of type Memo (currently). I can't help thinking it's something to do with the return characters but in my dummy data I also used return chars and it worked (displaying these as a square in access).

The first two fields work ok and they don't have return chars in them.

I would be very grateful if anyone be able to help with this please?

Many thanks.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 10:13
Joined
Jul 9, 2003
Messages
16,373
>>> in my dummy data I also used return chars and it worked <<<

Copy your dummy data into the relevant field in the word document and try the import again.
 

whitespace

Registered User.
Local time
Today, 02:13
Joined
Aug 30, 2005
Messages
51
I've sorted this now, I can't believe I've spent hours looking at this but the prob was that I've got a copy of this database on a different server and I was referring to the copy in my ADODB connection - so the cahnges I was making to field lengths weren't being applied to the database I was actually referring to in the code.

Arrrghh. Thanks anyway Uncle Gizmo.
 

Users who are viewing this thread

Top Bottom