Solved

Simple Text Records

Posted on 2006-11-25
2
149 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

624 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