SendObject stripping away leading 0s in Excel export

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?
 
D

Dave R.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top