Pathseeker
04-11-2003, 02:23 PM
I have program which looks up values in an access database to make a list box. Is it possible to have the list box look up values in a comma delaminated text file instead and then when you click on the item in the list box it retrieves the data also stored in the text file??
I realize its better/easier (at least it would seem) to have the information in a database but this is what I have been asked to do.
Any one have any help for me?? It would be greatly appreciated.
Thanks,
Ben
Mikecrosoft
04-11-2003, 02:38 PM
Using Open, Close, Input # and Write # functions you can achieve this purpose !
Pathseeker
04-11-2003, 03:38 PM
Using Open, Close, Input # and Write # functions you can achieve this purpose !
Thank you for the prevouse help however I have another question if you don't mind.
Im a total newbie.....I have it so I can load in items to the list box useing the line input so that an entire record form my text file apears on one line of the list box..however only the first line of my txt file is appearing in y list box.
Here is my code so far:
-----------------------------
Dim strRecordLine As String
Open "C:\TEST.txt" For Input As #1
Line Input #1, strRecordLine
Close #FileNum
List1.AddItem strRecordLine
------------------------------
I am assuming I need a Loop in there but Im sure if that would solve my problem or how to use a loop if it is? Do you have any suggestions?
Thanks,
Ben
Squirm
04-11-2003, 04:41 PM
Yes, use a Do..Loop loop, with EOF(1) as the terminating condition.