Results 1 to 7 of 7
  1. #1
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199

    Adding header and footer in Table

    I have a single column table which is created by set of queries, the data type is of memo, the single column table is a merge of a table with multiple columns by adding a space between the columns.



    This table is then exported to the txt file, i want to add header and footer which appears exactly on the position after exporting as of now the header and footer is occuring in between the table data.

    Please help.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    How are you exporting to txt file that causes header and footer between table data? What method are you using to export?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    DoCmd.TransferText acExportFixed, "Final Export Specification", "FINAL", CurrentProject.Path & "\mmdd01.txt", False

    I am inserting the header and footer by an insert query.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    Don't see anything wrong with that code. Perhaps issue is with the insert query. Would have to review. If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    Big Mess for making a copy and attache it

  6. #6
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    I am using transfer text only

    The reason of heaader and footer coming in middle is , before inserting in the table i am inserting header and footer and then rest of the Data.

    Due to which the header and footer goes in between, and when tranfer text command is clicked it transfers only as a stored table.

    The only chump here is i am inserting header and footer as normal table record, which the table fails to order. I am thinking to fix the order of header to top while in insert query and the footer on bottom which wil solve my problem, how to do it?

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,944
    Records in tables don't have a set order. A table is like a bucket with a bunch of coins tossed in. You can't depend on the 'header' record to be first and the 'footer' record to be last. Defining record order requires a query with sort criteria.

    Your options:

    1. export the table to Excel and create header and footer rows then save as text file.

    2. use VBA to open a text file object and write records to the text object, one line at a time.

    3. export a report to text file
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-14-2013, 07:01 PM
  2. Header and Footer
    By tcheck in forum Access
    Replies: 1
    Last Post: 11-08-2012, 02:23 PM
  3. header and footer
    By slimjen in forum Forms
    Replies: 2
    Last Post: 10-03-2011, 08:10 PM
  4. Replies: 3
    Last Post: 08-31-2011, 02:34 PM
  5. Replies: 3
    Last Post: 01-13-2011, 03:53 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums