Question : DoCmd.TransferSpreadsheet acImport and Excel field size >255

Hi There,

I've got an ACCESS (Xp) module that imports data from Excel spreadsheets using the following commmand line:
    DoCmd.TransferSpreadsheet acImport, , "tmpTNZI", _
    TheFile, False

where 'tmpTNZI' is the table name that the data from the Excel spreadsheet is written to and 'TheFile' is a string varaiable containing the path and file name of the source Excel spreadsheet.

The routine works fine, however one of the fields in the Excel spreadsheet sometimes has contents that are longer than 255 characters.  I thought that setting the target field in table 'tmpTNZI' to type 'memo' would solve the problem but it hasn't.  The contents of the EXcel cell get truncated at 255 characters when written to the ACCESS table. Any ideas on how to get round this one?

Cheers
M

Answer : DoCmd.TransferSpreadsheet acImport and Excel field size >255

Hi Mike
Out of the 2 I'd go for the first method...
Here's another idea Add to the beginning of the memo field an extra string of 255 characters & then get rid of it after importing...

Gary
Random Solutions  
 
programming4us programming4us