SendObject stripping away leading 0s in Excel export

  • Thread starter Thread starter Dave R.
  • Start date Start date
D

Dave R.

Hi - I am using the following command to export a query to excel and attach
it to an email.

DoCmd.SendObject acSendQuery, "1yr Follow-up-CHW", acFormatXLS, _
strToWhom, , , "Query ", _
, 1

It works OK except that when I open the XL file, it says "File error. Some
number formats may have been lost."

I can see that in one field(column) which in the database had text such as
0000234 are now transformed to numbers like 234, which screws things up
quite a bit.

Is there another way to email a query result without losing the formats in
the database?
 
Fixed it.. for anyone wondering, I set the format in the query as "" for
that field, as well as in the database. The query might have been enough.
 
Back
Top