Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Importing / Linking / July 2005

Tip: Looking for answers? Try searching our database.

ACH Data to a TXT file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark C - 22 Jul 2005 14:25 GMT
I am creating a NACHA file.  I have the format and have created the lines I
need to export.  The info is stored into an array and a few varriables.  I
need to send this data to a txt file and store it.

I have 2 questions.

1) how do I create and drop data from the VB part of Access into the Text
file?
2) how can I format the TXT file so that I can have 94 characters per line in
Landscape?

TIA for any help.
John Nurick - 23 Jul 2005 07:57 GMT
Hi Mark,

>I am creating a NACHA file.  I have the format and have created the lines I
>need to export.  The info is stored into an array and a few varriables.  I
[quoted text clipped - 4 lines]
>1) how do I create and drop data from the VB part of Access into the Text
>file?

Here's one way:

 Dim strFileSpec As String
 Dim blOverwrite As Boolean
 Dim lngFN As Long
 Dim strLine As String

 ...
 
 lngFN = FreeFile()
 If blOverwrite Then
   Open strFileSpec For Output As #lngFN
 Else
   Open strFileSpec For Append As #lngFN
 End If

 'write a line to the file
 strLine = "blah blah blah"
 Print #lngFN, strline
 'repeat as required

 Tidy up
 Close #lngFN

>2) how can I format the TXT file so that I can have 94 characters per line in
>Landscape?

You can use expressions like these to format the contents of a variable
as a string of a given length:

 Format(X, "000000.00") 'Right-aligns numeric value X with 2
                         decimal places in a 9-column field
                         padded with 0s
 Left(S & Space(20), 20)'Left-aligns string S in a 20-column
                         field padded with spaces

There's nothing in a text file to say whether it's portrait or
landscape: that's a decision for any software that may print it.  
 

>TIA for any help.

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
Mark C - 26 Jul 2005 14:54 GMT
Thanks a ton for the help

>Hi Mark,
>
[quoted text clipped - 50 lines]
>
>Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.