473,320 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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.


Expand|Select|Wrap|Line Numbers
  1.  
  2. Dim lngRet As Long
  3.     On Error GoTo fWriteRemoteReport_Err
  4.     '''''''''
  5.     'create a CSW in text file name
  6.         cswFilename = CStr(Format(Now, "mmddyyhhmmss"))
  7.         cswFilename = modInitialize.OrderInputFileLocation & "\CSW_" & cswFilename & ".txt"
  8.         Set objFSys = New FileSystemObject
  9.         If objFSys.FileExists(cswFilename) = False Then
  10.             objFSys.CreateTextFile (cswFilename)
  11.         End If
  12.         Set objFSys = Nothing
  13.  
  14.     If Len(Dir(strMDB)) > 0 Then
  15.         Set objAccess = New Access.Application
  16.         With objAccess
  17.             'lngRet = apiSetForegroundWindow(.hWndAccessApp)
  18.             'lngRet = apiShowWindow(.hWndAccessApp, 1)
  19.             .OpenCurrentDatabase strMDB
  20.             .DoCmd.OutputTo acOutputReport, "CSW", acFormatTXT, cswFilename, False
  21.             '.DoCmd.PrintOut , , , , 5
  22.         End With
  23.         objAccess.Quit
  24.     Set objAccess = Nothing
  25.  
  26.     End If
  27.     MsgBox "End of fWriteRemoteReport function"
  28.  
  29.  
Aug 6 '10 #1
0 956

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sunshine | last post by:
My original thought was to save the recordset into a text file. However, because of permissions I am unable to do this and will not be able to change the permissions. My next thought was to open...
1
by: Twopair | last post by:
I have a problem DB:SQL Server Field type is varchar and some data is unicode like this "峯" It is a chinese. How do I transfer the data I retrive from DB and then I can write it into an text...
16
by: nephish | last post by:
Hey there, kinda newbie question here. i know how to read the lines of a txt file. i know how to write a txt file. but how do i overwrite a line value with another value ? i mean, how do go...
14
by: Manish | last post by:
The project I am developing doesn't involves database. I want to parse the mailbox file (.mbx) and store the summary in the text file for fast retrieval and display of information in the Inbox...
5
by: RadhakrishnanR | last post by:
Hi, By using VB6.0, I want to export database table data into (i.e based on the selected file type(xls or txt)) excel file or text file with a tab delimited text file. My User interface has: ...
1
by: bvdrsganesh1981 | last post by:
Hello !!! Can u please suggest me , the way to Export the data from all the tables of the Data Base at a time in text files individually with file names similar to the table names . ...
4
by: sanparab | last post by:
I am a new user for MS Access 2003, I want to transfer a data of Fixed lenght text file into Access Tabel. The data is contained of four Record Set those are as follows 1. The header record...
21
by: Mick1000 | last post by:
Hi all, I am new to perl and this forum. I am trying to setup a mailing list subscription functionality for customers to receive a periodic newsletter from me. My perl program grabs the html form...
2
by: anii | last post by:
Hi there, I've got this piece of code, but I'm having trouble getting it to write the changes into the file. What I'm trying to do is: Read text file Find user specified character (eg. what...
3
by: madankarmukta | last post by:
Hi, Objectives is to write the DataTable content to the text file in the format Col1 | Col2 | Col3 ------|-------|--------- Val11 | Val21 | Val31 Val12 | Val22 | Val32 Val13 | Val23 |...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.