By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,490 Members | 1,489 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,490 IT Pros & Developers. It's quick & easy.

Printing multiple records on one line

P: 3
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
Apr 30 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 5K+
P: 8,434
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.
Apr 30 '07 #2

P: 3
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!
May 11 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.