Hi,
Ah, as I suspected; the problem is related to the size of a column in a
table. The quickest fix would be to change the "Output" column in "Output
Table - OT" from a text field to a memo field.
Unless you are massaging the data that you are exporting in some
complicated way, you most likely could eliminate that code entirely and just
use Access's export-as-fixed-width-text feature in conjuction with the query
or table that is the original source of the data. This is available in all
of the versions of Access that I have ever used. You will need to create an
export specification so that you can repeat the process without having to
define the output field sizes every time. If you give a try and run into
questions, post back.
Clifford Bass
Lost In Programming said:
Here you go. I'm betting this is very confusing. This databse was written
by a friend of mine who is MIA currently. I am sure there is a better way to
do this and I am really open to re-writing the code. I basically have a
table (tbldonations) that has about 30 fields in it for each record. Some
fields may have data, some are blank. I need to create an output file (.txt)
of all records entered on a certain date. I know I can pull the records with
a query for the date range I need. My problem is creating the .txt file and
making sure that the information for each record falls in specific positions
which go out as far as 597 positions.
For instance, one of my fields is [TitleCode]. On the output file, the 2
position title code must be in spaces 27 and 28, counting from the left to
the right. Next would be [FirstName] which must be in positions 29 through
44, left justified. After that would be [LastName] which must start in
position 45 and go through 60 left justified. This goes on and on until all
fields are accounted for through postion 597.
Where could I find code to do this? Or what can I try?
This is what you were asking about:
Public Function AddToStringTable(strInput As String) As Boolean
On Error GoTo Error_Catcher
Dim dbATS As Database
Dim rsTable As Recordset
Set dbATS = CurrentDb
Set rsTable = dbATS.OpenRecordset("Output Table - OT")
With rsTable
.AddNew
![Output].Value = strInput
.Update
.Close
End With
dbATS.Close
Error_Catcher_Exit:
Exit Function
Error_Catcher:
Resume Error_Catcher_Exit
End Function