Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

save list box values into a log file

Status
Not open for further replies.

SamNeo

Technical User
Jun 26, 2000
21
0
0
IN
I have problem with saving the results that appear in a list box into a log file and saving the file to disk. Can any one tell me how to do it.
 
Run this procedure:

Private Sub CreateLogFile()
Dim fs as Object
Dim a as Object
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("c:\testfile.txt", True)
For index = 0 to list0.ListCount-1
a.writeline(list0.itemdata(index))
Next index
a.Close
End Sub

This assumes that the bound column of your list box isthe field you want to output.

ntp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top