Writing table valuesd to specific positions

chris-uk-lad

Registered User.
Local time
Today, 14:43
Joined
Jul 8, 2008
Messages
271
Hi all
In the below example, can anyone tell me how id
A) Specify what position in the text document A2 is written? I want it next to A1 but starting at a specific position
B) Force A3 to be written on a new Line, without moving onto the next member.
Code:
Do Until rset.EOF = True
    TextFile.WriteLine (" &rset!A1 & " " & rset!A2 & ")
    TextFile.WriteLine (" &rset!A3 & ")
    rset.movenext
Loop
Hopeful outcome:
James __________ Shaw
Westways
Robertson _______ Shaw
Queys

(_ indicates space :s)
 
if you want it a specific positon, you need to count (len) the size of A1, and insert spaces. You could write a function to pad a string to a specific size

eg, so you get

pad(a1,40) & pad(a2,10) etc ...
 
if you want it a specific positon, you need to count (len) the size of A1, and insert spaces. You could write a function to pad a string to a specific size

eg, so you get

pad(a1,40) & pad(a2,10) etc ...

appreciate it, will use:

Code:
((rset!A1& (String(30 - Len("&rset!A1&"), " ")))

Any advice on how to use the same members information on a new line? before switching to the next membrer in the recordset?
 
Last edited:
not sure what yuo mean

does writeline not add a CR/LF (ie go to next line)

if not just add

textfile.writeline (vbcrlf)
 

Users who are viewing this thread

Back
Top Bottom