write same data in multiple time in same text file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nilesh tayde
    New Member
    • Jul 2010
    • 4

    write same data in multiple time in same text file

    Hi all

    i want to write same data in single text file multiple times using this code. for singel time it work fine.


    Code:
    Dim lngRet As Long
        On Error GoTo fWriteRemoteReport_Err
        '''''''''
        'create a CSW in text file name
            cswFilename = CStr(Format(Now, "mmddyyhhmmss"))
            cswFilename = modInitialize.OrderInputFileLocation & "\CSW_" & cswFilename & ".txt"
            Set objFSys = New FileSystemObject
            If objFSys.FileExists(cswFilename) = False Then
                objFSys.CreateTextFile (cswFilename)
            End If
            Set objFSys = Nothing
            
        If Len(Dir(strMDB)) > 0 Then
            Set objAccess = New Access.Application
            With objAccess
                'lngRet = apiSetForegroundWindow(.hWndAccessApp)
                'lngRet = apiShowWindow(.hWndAccessApp, 1)
                .OpenCurrentDatabase strMDB
                .DoCmd.OutputTo acOutputReport, "CSW", acFormatTXT, cswFilename, False
                '.DoCmd.PrintOut , , , , 5
            End With
            objAccess.Quit
        Set objAccess = Nothing
    
        End If
        MsgBox "End of fWriteRemoteReport function"
Working...