elletter
asked on
VBA code to export an MS Access query to a text file
Hello Experts,
I need help with the VBA code to export a query run in access to a text file. I have little experience with VBA and don't even have a clue where to start.
I hope someone can point me in the right direction.
Thank you.
I need help with the VBA code to export a query run in access to a text file. I have little experience with VBA and don't even have a clue where to start.
I hope someone can point me in the right direction.
Thank you.
ASKER
Sorry I should have been a bit more specific. The query contains 5 fields and I need to export them to a text file in the format below
ASE-bab 111.42 J384229 17016.2126 33299.82
There are predetermine spaces between the fields. I want to create this output for EDI purposes.
Hope i was able to be more clearer.
Thank you.
ASE-bab 111.42 J384229 17016.2126 33299.82
There are predetermine spaces between the fields. I want to create this output for EDI purposes.
Hope i was able to be more clearer.
Thank you.
Do you know how to create specifications to import a fixed width file?
This is something you might have done if you imported files in a format similar to the one you seek to create.
Also, tell us on which version of Access you are working.
This is something you might have done if you imported files in a format similar to the one you seek to create.
Also, tell us on which version of Access you are working.
ASKER
I'm not familiar with that and I'm using ACCESS 2010.
Thanks for the help.
Thanks for the help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This code solved my problem adding vbNewLine completed everything i need it.
DoCmd.TransferText acExportDelim, "", "YourQueryName", "Filename with path", False, ""