Open log For Append As #2
EMD = DLookup("[EMD]", "tblFilePath", "[PathID]=1") & Rename
NoPax = DLookup("[NoPax]", "tblFilePath", "[PathID]=1") & Rename
Set RSFiles = CurrentDb.OpenRecordset("tblFiles")
Set RSPax = CurrentDb.OpenRecordset("tblPax")
Set RSPXFare = CurrentDb.OpenRecordset("tblPAXFareValue")
Set RSSector = CurrentDb.OpenRecordset("tblSector")
Set RSFop = CurrentDb.OpenRecordset("tblFop")
Set RSEx = CurrentDb.OpenRecordset("tblExchange")
'Set fs = CreateObject("Scripting.FileSystemObject")
'Set a = fs.CreateTextFile(log, True)
Open log For Append As #2
NextFile:
srcfile = Dir 'get next file
Loop 'srcfile
RSFiles.Close
RSPax.Close
RSPXFare.Close
RSSector.Close
RSFop.Close
RSEx.Close
Write #2, txtMIRActivity.Value
Close #2
Open log For Append As #2
log = "C:\MIR\" & Date & "MirActivityLog.txt"
[COLOR=Red]Flen = FileLen(log)[/COLOR]
If Flen > 5 Then
MsgBox ("File length Reached")
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(log, True)
Else
Open log For Append As #2
End If
LFile = "C:\MIR\19-Jan-15_MIRActivityMIR.txt"
If LFile = "" Then
Set lf = fs.CreateTextFile("C:\MIR\" & Date & "_" & "MIRActivityLog.txt", True)
[COLOR=Red]Flen = FileLen(LFile)[/COLOR]
Else
Open LFile For Append As #2
End If
If Flen > 5 Then
MsgBox ("File length Reached")
Set NF = fs.CreateTextFile(Now & "_" & "C:\MIR\19-Jan-15_MIRActivityMIR.txt", True)
End If
LogF = "C:\MIR\"
NewF = LogF & Rename & "MIRActivityLogg.txt"
LFile = "C:\MIR\" & Date & "_" & "MIRActivityLog.txt"
If LFile = "" Then
Set lf = fs.CreateTextFile(LogF & Date & "_" & "MIRActivityLog.txt", True)
Else
Open LFile For Append As #2
End If
[B][COLOR=Red]Flen = FileLen(LFile)[/COLOR][/B]
If Flen > 10000000 Then
Set NF = fs.CreateTextFile(NewF, True)
End If
Can't find the difference here. Seems both are the same.
If DCount("FileID", "qryMIR", "[MIRSeq]=" & MIRSeq) And DCount("FileID", "qryMIR", "[TicketNumber]=""" & tkt & """") Then 'validate MIR Sequence number and Ticketnumber to avoid Duplication
txtMIRActivity.Value = srcfile & " " & MIRSeq & " " & tkt & " " & PNR & " " & "DUPLICATE MIR FILE" & vbNewLine & txtMIRActivity.Value
Print #2, srcfile & " " & MIRSeq & " " & tkt & " " & PNR & " " & "DUPLICATE MIR FILE"
Close #1
Name SrcFolder & srcfile As dupfolder & srcfile 'Move Duplicate file
GoTo NextFile
End If
Dcount("FileID", "qryMIR", "[MIRSeq]=" & MIRSeq & " and [TicketNumber]=""" & tkt & """") then
Dcount("FileID", "qryMIR", "[SomeField]=" & MIRSeq ) then
dim rs as DAO.Recordset
set rs = Currentdb.Openrecordset("Select ...")
If ...
end if
If ...
End if
rs.close
set rs = nothing