guerillaaccess
New member
- Local time
- Today, 09:03
- Joined
- Sep 5, 2013
- Messages
- 5
Hi, I have a text file that I am using VBA to read and print 2 pieces of data to another text file.
The code works to a point, in some instances it does not appear to find the end of file but captures and writes all the data. Or, after printing 36 lines correctly, it then stops writing.
I have stepped through the code and it appears to be capturing the data up past this issue but for what ever reason it does not print it to my text file. :banghead:
Anyone able to have a look and maybe offer some guideance as to what I'm doing wrong?
Cheers.
The code works to a point, in some instances it does not appear to find the end of file but captures and writes all the data. Or, after printing 36 lines correctly, it then stops writing.
I have stepped through the code and it appears to be capturing the data up past this issue but for what ever reason it does not print it to my text file. :banghead:
Anyone able to have a look and maybe offer some guideance as to what I'm doing wrong?
Cheers.
PHP:
Option Compare Database
Option Explicit
Public Mode As String
Public FUNDREF As String
Public rst As String
Function DAILYAUDITTRAIL()
Close #1
Close #2
Open "C:\Users\TEST IN.TXT" For Input As #1
Open "C:\Users\TEST OUT.txt" For Output As #2
Do While Not EOF(1)
Line Input #1, rst
If rst Like "KM56Aasdf*" Then
FUNDFINDER
End If
Loop
End Function
Function FUNDFINDER()
Do While Not rst Like "*RUN TERM*"
Do Until rst Like "FM: Mode:*"
If rst Like "*RUN TERM*" Then
GoTo Printer
End If
Line Input #1, rst
Loop
Mode = Trim(Right(rst, 6))
Do Until rst Like "Fund Reference *"
Line Input #1, rst
Loop
FUNDREF = Right(rst, 6)
Print #2, Mode & ";" & FUNDREF
Loop
Printer:
End Function