Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Simple Text Records

Posted on 2006-11-25
2
Medium Priority
?
152 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 140 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

721 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