DoCmd.TransferSpreadsheet acExport 10


I am trying to transfer data using below query. many columns in the below query have got dates in date format. When I transfer below query, I am getting attached message window. how can I stop this window from popping up? Also, I created a table using below given query (QryReportDetailMkQry) and replace the query name with table name in blow script. The script does not output the dataset into the Reports.xlsx

Public Sub Export()
ilDatCretd = FileDateTime("path"
DoCmd.TransferSpreadsheet acExport, 10, "QryReportDetailQry", "C:\NtRp\Reports\Reports.xlsx", True, "RprtDtl" & "." & Format(FilDatCretd, "ddmmyy hhmm")
End Sub

Asatoma SadgamayaAnalystAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You get that error on an EXPORT process? You generally see errors like that on an Import.
Umm something like

docmd.setwarnings false

do what you want?

If it was me I'd pull up the query and run the export to excel command and check  out what didn't make it over.  That may help you eliminate the error in a way that the fields aren't lost.

Good Luck!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Asatoma SadgamayaAnalystAuthor Commented:
Thanks ScriptAddict,

I like your docmd.setwarnings false. that worked for me. Basically the query i need to transfer has got lots of function on each column because of this function it shows #Error on the query wherever there is no values. but when I transfer this query data set into excel, i can't find any #Error on it. Only problem was vba throws warning message.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.