Class module to load filenames into a listbox

  • Thread starter Thread starter JDB
  • Start date Start date
J

JDB

Does anyone point me to a class module to load filenames into a list
box so they can be selected for use within the VBA??

thanks

JDB
 
JDB said:
Does anyone point me to a class module to load filenames into a list
box so they can be selected for use within the VBA??

thanks

JDB

This

http://www.smccall.demon.co.uk/Downloads.htm#FsRecurse

will scan a specific path, either recursively (including subfolders) or not.
The demo fills a textbox, but all it needs to change to filling a listbox is
to change the event procedure fs_FileFound to something like:

Me.ListBoxName.AddItem FileName
 
JDB said:
Does anyone point me to a class module to load filenames into a list
box so they can be selected for use within the VBA??

thanks

JDB

This

http://www.smccall.demon.co.uk/Downloads.htm#FsRecurse

will scan a specific path, either recursively (including subfolders) or not.
The demo fills a textbox, but all it needs to change to filling a listbox is
to change the event procedure fs_FileFound to something like:

Me.ListBoxName.AddItem FileName
 
Thank you this question is helpful for me but how can I change the event
procedure fs_FileFound or where can I add this statement
Me.ListBoxName.AddItem FileName

ab
 
Thank you this question is helpful for me but how can I change the event
procedure fs_FileFound or where can I add this statement
Me.ListBoxName.AddItem FileName

ab
 
abkad said:
Thank you this question is helpful for me but how can I change the event
procedure fs_FileFound or where can I add this statement
Me.ListBoxName.AddItem FileName

ab

First of all, open the form in design view (after first making a copy),
right-click on the big textbox control and select 'Change To' then select
Listbox.

Open the form's module, find the fs_FileFound procedure and replace the
contents with the above statement. Obviously you need to change ListboxName
to the actual name on the form which, if you haven't changed it, is Text0.
IOW the line should read:

Me.Text0.AddItem FileName

Save the design, then open the form normally and try it out. Should work
straight out of the box.
 
abkad said:
Thank you this question is helpful for me but how can I change the event
procedure fs_FileFound or where can I add this statement
Me.ListBoxName.AddItem FileName

ab

First of all, open the form in design view (after first making a copy),
right-click on the big textbox control and select 'Change To' then select
Listbox.

Open the form's module, find the fs_FileFound procedure and replace the
contents with the above statement. Obviously you need to change ListboxName
to the actual name on the form which, if you haven't changed it, is Text0.
IOW the line should read:

Me.Text0.AddItem FileName

Save the design, then open the form normally and try it out. Should work
straight out of the box.
 
thank you for your help I did as you said but this massege appear to me "The
rowsource property must be set to 'value list' to use this methode"
 
thank you for your help I did as you said but this massege appear to me "The
rowsource property must be set to 'value list' to use this methode"
 
Back
Top