Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Export

Status
Not open for further replies.

elwood00

Technical User
Feb 15, 2005
12
0
0
US
I am dealing with a program that has very limited import capabilities. Therefore, I would need to combine several fields of my Access table (e.g. First Name and Last Name into one field NAME) before exporting it as delimited ASCII. So far I have exported to Excel and then done it there - but there has to be a direct way..... I just cant find it....

Thanks
 
You can design a query that chooses and combines the fields the way you want, then export the results of the query.

I try not to let my ignorance prevent me from offering a strong opinion.
 
You can concatenate fields in Access with the & like

[First Name] & " " & [Last Name]



Hope this helps.

OnTheFly
 
once you write your query concatenating the first name and last name fields together, you could make a form, add a command button to the form, and behind the command button include some VBA to export the query results as an ASCII file. Something like this would work

DoCmd.OutputTo acOutputTable, "tblTemp", acFormatTXT, strExportFileName, -1

(When I export from MS Access I use a "report extract" temp table to hold the data prior to exporting it. I find that exporting from a table is less problematic than exporting from a query. In my example, tblTemp is the name of the temporary table that holds the data I am about to export. strExportFileName is a string variable previously defined in my VBA module that lists the name I want the exported text file to have. If you do not want to use a string variable, you could hard code whatever file name you would like your exported file to have provided the exported file name was surrounded by quotes. The -1 argument tells the computer to automatically open the exported text file once it is created. Using a 0 instead of -1 would instruct the computer to just create the text export file and not open it.)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top