Reading file name from text box and/or File List Box 
Author Message
 Reading file name from text box and/or File List Box

Hello friends out there:

I am new to VB so please don't laugh on my question. I am writing a
program in which I want the user to supply a file name (for opening as
sequential file) either through a text box or thorough a File List
control. It works fine with the text box, but not with the control. File
name is not transferred from the control to my program subroutine
(variable).

Any suggestions?

Thanks.

Anil Namdeo



Fri, 06 Apr 2001 03:00:00 GMT  
 Reading file name from text box and/or File List Box
Are you using FileListControl.Filename to pass the filename.  If so, you
will probably need to tack on the path before the filename.
FileListControl.Filename returns *only* the filename and *not* the path.
I.e., returns RegEdit.exe *not* C:\Windows\RegEdit.exe.  The file will not
open unless you specify the full path.

Hope this helps.

MJ

Quote:

>Hello friends out there:

>I am new to VB so please don't laugh on my question. I am writing a
>program in which I want the user to supply a file name (for opening as
>sequential file) either through a text box or thorough a File List
>control. It works fine with the text box, but not with the control. File
>name is not transferred from the control to my program subroutine
>(variable).

>Any suggestions?

>Thanks.

>Anil Namdeo



Fri, 06 Apr 2001 03:00:00 GMT  
 Reading file name from text box and/or File List Box
To fill a list box you need to additem each line this was sent to me if you
don't get it drop me a line

To save combo1 content to the file test.txt, the file is stored in the
application folder:
'*****SAVING
MyFilename=app.path & "\test.txt":filenum=freefile
open MyFilename for output as #filenum
    for i=0 to combo1.listcount-1
        Print #Filenum, combo1.list(lop)
    next i
Close #Filenum

'*****LOADING
MyFilename=app.path & "\test.txt":filenum=freefile
open MyFilename for input as #filenum
While not eof (#filenum)
    Line input #Filenum, Dummy$
    combo1.additem Dummy$
wend
Close #filenum



Sat, 07 Apr 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB6 - file list box / drive box question - resolving network paths and computer names

2. Long File Names in File List Box

3. Help wanted with file list boxes and list boxes

4. reading a text file to display in text box

5. Reading a text file and piping it into a text box

6. How to list macro names in a combo box or a list box

7. Limiting Access to Text Boxes, List Boxes and Combo Boxes

8. Columns in List box, when inserting text from text box (VBA)

9. Read and list mpp files in a dialogue box with VBA

10. Adding multiple items from File Box to List box

11. How to read file contents into list box.

12. Highlight a File List box from an option box

 

 
Powered by phpBB® Forum Software