Leigh46137
Registered User.
- Local time
- Today, 14:01
- Joined
- Dec 29, 2009
- Messages
- 12
I have an Access Runtime database (Created in version 2007) that exports the results of a query to a text file that gets uploaded to another application.
I have a button that just opens the query for viewing and that works fine. I can scroll through the records and don't get any errors. The query does some lookups, concatenation and calculations, but does not have any selection criteria.
I have another button that runs the export. The code looks like this:
DoCmd.OpenQuery "WebExport"
DoCmd.RunCommand acCmdExportText
DoCmd.Close acQuery, "WebExport"
DoCmd.OpenQuery "WebCategoriesStatusTrue"
DoCmd.Close acQuery, "WebCategoriesStatusTrue"
When I run it, the query opens and the export text wizard opens. I specify the file location and click 'Finish'. Within just a few seconds it pops up an error message: "Data type mismatch in criteria expression."
It is exporting data to a TEXT file. What criteria expression is it choking on?
The code runs fine on my development machine with full Access 2007 and old data. I can't see any problems with the new data on the runtime machine.
Can anyone tell me how to correct this? Or work around it?
I'm not opposed to writing code to create my file, but I can't have strings enclosed in quotation marks. I don't know how to prevent that.
I have a button that just opens the query for viewing and that works fine. I can scroll through the records and don't get any errors. The query does some lookups, concatenation and calculations, but does not have any selection criteria.
I have another button that runs the export. The code looks like this:
DoCmd.OpenQuery "WebExport"
DoCmd.RunCommand acCmdExportText
DoCmd.Close acQuery, "WebExport"
DoCmd.OpenQuery "WebCategoriesStatusTrue"
DoCmd.Close acQuery, "WebCategoriesStatusTrue"
When I run it, the query opens and the export text wizard opens. I specify the file location and click 'Finish'. Within just a few seconds it pops up an error message: "Data type mismatch in criteria expression."
The code runs fine on my development machine with full Access 2007 and old data. I can't see any problems with the new data on the runtime machine.
Can anyone tell me how to correct this? Or work around it?
I'm not opposed to writing code to create my file, but I can't have strings enclosed in quotation marks. I don't know how to prevent that.