Reputation:
Does anyone know how to export an Access table ("Active Table" in the scenario below) to a .txt file with the Column Headings?
The scenario is below:
Swithcboard Functions: 1. Users add rows or edits rows. 2. The users will click on "View Selected Day", and enter the Day e.g.3 (In the background, the View Macro runs and query filters for Active persons with an Effective day of 3; and read only results are displayed) 3. The users will click on "Export Selected Day" (In the background, the Query replaces the value in "Active Table", with the results for the chosen Effective Day in step 2. The Export Macro then exports the results from Active Table into a .txt file on the desktop)
The query is built as follows: "EmployeeName:left([Employee Name] & Space(22),22)", "Employee ID", "RT #", "A/C #: Format([A/C Number],"000000000000")", "Amount$: Format$([Amount],"000000.00")", "Effective Day" with criteria "[Please enter Effective Day]", "Status" with criteria "Active"
ANy will will be greatly appreciated Thanks Brandy
Upvotes: 2
Views: 7722
Reputation: 446
You have to check "Include Field Names on First Row".
As the "red circle" showed on the step 4 screenshots:
Upvotes: 2
Reputation: 91376
Have you considered TransferText?
Syntax (remove line break)
DoCmd.TransferText [transfertype][, specificationname],
tablename, filename[, hasfieldnames][, HTMLtablename][, codepage]
Upvotes: 1