macros - What's a Solution or Formula to export a text field with padded spaces in Access 2003, to a txt file -
Using the Access Access 2003 database, with 2 tables, and a single query, macros for viewing files, and exporting To do macro files (delimited, not fixed), and a form.
The main table is created as follows: "employee's name"; Data type: text, field size: 22 "employee ID"; Data type: text, field size: 22 "RT #"; Data type: text, field size: 9 "A / c number"; Data type: text, field size: 15 "zodiac"; Data Type: Number, Field Size: Decimal, Format: Standard, Precision: 9, Scale: 2, Decimal Places: 2 "Effective Days"; Data type: text, field size: 2 "status"; Data type: text, field size: 255
The secondary table "active table" is created as follows: "employee's name"; Data type: text, field size: 22 "employee ID"; Data type: text, field size: 22 "RT #"; Data type: text, field size: 9 "A / c number"; Data Type: Text, Field Size: 15 "Amount $"; Data type: text, field size: 255 "effective day"; Data type: text, field size: 2 "status"; Data type: text, field size: 255
The query is created as follows: "employee's name" "employee ID" "RT #" "A / c number" "amount $: criteria" active "
Along with the criteria "[Enter the effective day]" "Status" format $ ([zodiac], "000000.00") 2 macros with "effective day" 1. View: Open Question (active AEC in the day), Open Form (FRM_vive_activ_table) 2. Export: Transfer Text (Transfer Type: CD Export: Table Name: Active Table)
A form frames_viv_activ_tables
There is also a switchboard with the options: Add & amp; Edit; Export selected days Exclude the selected day
How to work slithboard: 1. User rows or Add editing rows 2. Users will click on "view selected day", and enter like day 3 (in the background, see Macro Running and for an active day of active day 3 The second query queries the filter; and only the reading results are displayed) 3. Users will click on "Export Selected Days" (in the background, the value of the query in the "active table", the effective day selected in step 2 With the result. Export Macro then exports this result to the .txt file on the desktop)
In the export file, for the different text fields, the different length active table, with the exception of the amount $ field, with a definite of 9 characters With the amount (which is also added in the main table, the query pad by 0 to 9 characters, so it is exported to 9 characters with leading 0).
I need to set a fixed length for all other exported text areas. The employee's name should be 22 characters, and 22 should be padded with spaces to the empty space if the person's name Less than 22 characters.
Does anybody know that my query, for inventing letters like Padding my text field to the employee name till 22, so that when the file is exported, then it has a certain letter (the letter And invisible)
Any help would be greatly appreciated.
Just note: I tried to install my export macro as a transfer type: fixed length; But this closes my last two columns with effective days and positions (2 fields with the criteria added in my query)
To make a string pad in 22 letters or smaller:
When you finally add 22 spaces, you take the left 22 characters of the string you have created.
Comments
Post a Comment