yea i think so . thnx... u 've answered it. anyway this is the code
Private Sub CmdChkFile_Click()
Dim fs As FileSystemObject
Dim ts As TextStream, ts1 As TextStream, ts2 As TextStream
Set fs = CreateObject("Scripting.FileSystemObject")
Set ts = fs.OpenTextFile(DatFName, ForReading)
Set ts1 = fs.OpenTextFile(HdrFName, ForReading)
Set ts2 = fs.CreateTextFile(DatFName & "_" & Format(Date, "ddmmyy") & ".rpt")
Dim MyVar As String, MyCheck As String
Dim line As Integer, totalline As Integer, i As Integer
Dim SumCP, SumCN, SumDP, SumDN
Dim HashTPurse, HashTNPurse
Do While Not ts.AtEndOfStream
d = ts.ReadLine
Call tracingFNDat(Mystring)
'function '
line = line + 1
If Trim(Mfgno) = "" Then lbl2.Caption = lbl2.Caption & " mfgNo line =" & line
If Trim(CardTran) = "" Then lbl3.Caption = lbl3.Caption & " crdtraNo line =" & line
totalline = line
Loop
Do While Not ts1.AtEndOfStream
h = ts1.ReadLine
Call tracingFNHdr(Mystring)
Loop
If Trim(RecordCount) <> totalline Then lbl1.Caption = "-BV03- Record Count is mismatch"
If totalline = 0 Then lbl1.Caption = " -BV10- Record Error "
If Val(CP) <> SumCP Then lbl8.Caption = lbl8.Caption & " -BV04- Credit Purse mismatch"
If Val(DP) <> SumDP Then lbl9.Caption = lbl9.Caption & " -BV04- Debit Purse mismatch"
If Val(CN) <> SumCN Then lbl10.Caption = " -BV05- Credit Non Purse mismatch"
HashTPurse = SumCP - SumDP
HashTNPurse = SumCN - SumDN
'Writing'
vmsg = vmsg & DatFName & Chr$(13) & Chr$(10) & _
"--------------------------------------------------------------" & Chr$(13) & Chr$(10) & _
"Error Record = " & lbl1.Caption & Chr$(13) & Chr$(10) & _
"Error Line = " & lbl2.Caption & Chr$(13) & Chr$(10) & _
"Error Line = " & lbl3.Caption & Chr(13) & Chr$(10) & _
"Error Line = " & lbl4.Caption & Chr(13) & Chr$(10) & _
"Error Line = " & lbl5.Caption & Chr(13) & Chr$(10) & _
lbl8.Caption & Chr$(13) & Chr$(10) & _
lbl9.Caption & Chr$(13) & Chr$(10) & _
lbl10.Caption & Chr$(13) & Chr$(10) & _
lbl11.Caption & Chr$(13) & Chr$(10) & _
lbl12.Caption & Chr$(13) & Chr$(10) & _
lbl13.Caption & Chr$(13) & Chr$(10) _
& Chr$(13) & Chr$(10) & Chr$(13) & Chr$(10) _
& Chr$(13) & Chr$(10) & Chr$(13) & Chr$(10) _
ts2.WriteLine (vmsg)
Call Shell("notepad.exe " & (DatFName & "_" & Format(Date, "ddmmyy") & ".rpt"), ForReading)
is there anyway to close this notepad??? that's what im thinking actually... anyway millions of thank you
End Sub