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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving Data from a List Box to A text file

Status
Not open for further replies.
Jun 26, 2001
41
US
I have a form with multiple combo boxes on it. When they are selected then information pertaining to those combo boxes are displayed in a list box. I want to move some of that information in the list box into a text file. Does anyone have any example code of how to do this?

Thanks,
Byron
 
I got it now so I can move one column one row. But how can set it up so I can move all rows for that one column.

Byron
 
need to refer to the other columns for that row as well
example:

me.text2 = me.list1.[column](0)& me.list1.[column](1)& me.list1.[column](2)

Good luck
 
Thanks for your input but I just need to move the data for all rows in column three to a text file.

Here is my code that I am using:

Open "C:\My Documents\Project\output.txt" For Output As #1
b = Forms!Compare!picList.Column(2, 1)
C = Forms!Compare!picList2.Column(2, 1)
Print #1, b, C
Close #1

This moves data from column three row one to a text file. How would I code it so I move all rows from column three?
 
never tried it but my guess would be a loop

dim x as integer, rowcnt as integer
dim b as string, c as string

rowcount = me.piclst.listcount 'adjust if heading or not

for x = 1 to rowcount
b = b & Forms!Compare!picList.Column(2, x)
C = c & Forms!Compare!picList2.Column(2, x)
next x

Open "C:\My Documents\Project\output.txt" For Output As #1
Print #1, b, C
Close #1

Something like that
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top