Solved

Simple Text Records

Posted on 2006-11-25
2
143 Views
Last Modified: 2011-09-20
This is simple, I just don't know how....

I have a timer in VB6 that runs every 30 seconds.  When it runs, I want a record added to a text file with the date/time stamp.  The way I have it now, it overwrites the previous text file with the new time, instead of keeping what is there, then adding a new line in the text file for the new timestamp.

Here is what I have:

******* Start Code *****
Sub Timer1_Timer()
        Open "C:\test\stamp.txt" For Output Access Write As #3
        Print #3, Date & " " & Time
        Close #3
End Sub
***** End Code *******


I don't want to read in from the text file each time, I just want to add a new line (with line feed?) with the new date and time.   The idea is to keep a list of everytime the timer fires.

Thanks as always for any light you can shed on this incredibly problem.  :-)
0
Comment
Question by:Danimal
2 Comments
 
LVL 29

Accepted Solution

by:
Nightman earned 35 total points
ID: 18010738
Try this:
******* Start Code *****
Sub Timer1_Timer()
    Open C:\test\stamp.txt For Append Shared As #3
    Print #3, Date & " " & Time
    Close #3
End Sub
***** End Code *******
0
 
LVL 1

Author Comment

by:Danimal
ID: 18010788
that's what I needed...YOU are da man!

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now