execution of this application has stopped due to a run-time error (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 14:34
Joined
Sep 21, 2011
Messages
14,235
As you indicated, it is exactly the same as what I have, infarct, it is default
except for Decimal, symbol which I now changed

View attachment 91467

It seems to export as expected.

I would really like it to be saved on the desktop instead of the current project path and also would like it to open as soon as it has been exported

Thank you so much for the assistance, i know I usually get all frustrated then I don't listen :), causing frustration on your side
No reason why it cannot be on your desktop?
change strExportFile to

Code:
strExportFile = Environ("UserProfile") & "\Desktop\CS Order Line Items.csv"

Then Google/research on how to open the csv file.
Search here, as there is code that will open any file depending on the extension using it's default program.

Do you actually have an export spec called Order Line Items now that can be used like this, as normally it is not the simple save Spec, but you have to use the Advanced option, which is confusing. :unsure:
 

Gismo

Registered User.
Local time
Today, 16:34
Joined
Jun 12, 2017
Messages
1,298
No reason why it cannot be on your desktop?
change strExportFile to

Code:
strExportFile = Environ("UserProfile") & "\Desktop\CS Order Line Items.csv"

Then Google/research on how to open the csv file.
Search here, as there is code that will open any file depending on the extension using it's default program.

Do you actually have an export spec called Order Line Items now that can be used like this, as normally it is not the simple save Spec, but you have to use the Advanced option, which is confusing. :unsure:
Thank you

Yes, I have the spec created, looks fine but i will have to create a new spec as fixed width i think as the users will have issue and as is, it is already difficult using google sheets in stead of Excel.

I did the column with manually in the spec

for now, I will run all my exports without the spec, will test to see the outcome

Saving to Desktop now works perfect, but if I delete the spec and I edit the code to not include the spec, as per below, I get the error again

'DoCmd.TransferText acExportDelim, strExportSpec, strTabletoExport, strExportFile, blnHasHeaders
DoCmd.TransferText acExportDelim, , strTabletoExport, strExportFile, blnHasHeaders

1620811691786.png
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 14:34
Joined
Sep 21, 2011
Messages
14,235
I don't see why? It is only a few more clicks using Google, but still easy to do?
 

Users who are viewing this thread

Top Bottom