Printing multiple records on one line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • HansyW
    New Member
    • Apr 2007
    • 3

    #1

    Printing multiple records on one line

    Please help

    I m reading data and need to output to a file. For each record, I have a header and several details records. I need the header to be on one line, all the details on another line , and carriage return should be at the end of each record only.
    This is roughly what I m doing.

    while not eof
    Open App.Path & filedate & ".txt" For Append Access Write As #1

    If not same header Then
    Print #1, data, data, data
    End If
    '-- PRINTING detail records --
    Print #1, detail1, detail2

    Close #1
    RSt1.MoveNext
    ---------------------------------------------------------------------------------------
    I m not able to get my details to be on line line - they print on each line
    help
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Use the semicolon (;) at the end of each data record, to indicate to VB not to do a line break yet. Then, when you are sure that you do want a line break, do another Print with no contents.

    Comment

    • HansyW
      New Member
      • Apr 2007
      • 3

      #3
      Originally posted by Killer42
      Use the semicolon (;) at the end of each data record, to indicate to VB not to do a line break yet. Then, when you are sure that you do want a line break, do another Print with no contents.

      Thank you very much!

      Comment

      Working...