VB Code:
  1. Private Sub Command1_Click()
  2.  
  3.     Dim strFileText As String
  4.    
  5.     Open "C:\Path\LogFile.txt" For Append As #1
  6.    
  7.         [color=green] 'Loop throught the current file lines saving them to a string.[/color]
  8.         Do While Not EOF(1)
  9.    
  10.             strFileText = strFileText & Input(LOF(1), 1)
  11.        
  12.         Loop
  13.    
  14.         [color=green] ' Write out the textbox values to the file.[/color]
  15.         Print #1, "Record Created: " & txtDateTime.Text & _
  16.         "   By: " & txtUserName.Text & vbCrLf
  17.        
  18.         [color=green] 'Followed by the original file's text.[/color]
  19.         Print #1, strFileText
  20.    
  21.     Close #1
  22.    
  23. End Sub