R
Rich
I have an output utility for producting custom text
files. When I output fixed width files I lose the last
character. A table of 4 columns with widths of
12,10,10,10 produces a text of 41 characters, 12,10,10 and
9. This happens whether the last field is empty, partial
or full. If I add 1 to the last field it is okay, but the
last field is decided by the user so it is not set. I
could track the last field and add one, but I should not
have to. Similiar code works in other programs so I am
hoping that it is just my inexpierence with Access that is
the problem.
Do While Not rs.EOF
rsOutName.MoveFirst
For i = 1 To outnumber 'number of fields selected
flen = rsOutName("FieldLen")
fld = rsOutName("FieldName")
LineToOutput = LineToOutput & Left(rs(fld) & Space
(100), flen)
rsOutName.MoveNext
Next i
Print #1, LineToOutput
rs.MoveNext
rsOutName.MoveFirst
LineToOutput = ""
Loop
files. When I output fixed width files I lose the last
character. A table of 4 columns with widths of
12,10,10,10 produces a text of 41 characters, 12,10,10 and
9. This happens whether the last field is empty, partial
or full. If I add 1 to the last field it is okay, but the
last field is decided by the user so it is not set. I
could track the last field and add one, but I should not
have to. Similiar code works in other programs so I am
hoping that it is just my inexpierence with Access that is
the problem.
Do While Not rs.EOF
rsOutName.MoveFirst
For i = 1 To outnumber 'number of fields selected
flen = rsOutName("FieldLen")
fld = rsOutName("FieldName")
LineToOutput = LineToOutput & Left(rs(fld) & Space
(100), flen)
rsOutName.MoveNext
Next i
Print #1, LineToOutput
rs.MoveNext
rsOutName.MoveFirst
LineToOutput = ""
Loop