Populate ListBox on Form of Files in specificed Dir

HunterN

Active Member
Joined
Mar 19, 2002
Messages
479
Hi,

I am transferring my modules and forms over from Excel VB to Access and this is what I want to do. I want to:

Set a specific directory to be the directory to look in. Then set the extension = to '.xls'.
Then populate my ListBox with just those '.xls' files it finds. This way the user only has the ability to select certain files.

Then when they select one, I use this filename to open it in a database.

So far I have code that opens a dialog box starting at a certain point. But, I want to limit the files that they see. Plus, I want to make it look just like it did when this form was in Excel.

I would really appreciate an example if someone has one.


Thanks,
Nancy
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Thank you Bob,

I created myself a test database and created the Form. This worked great! It's exactly what I wanted.

Thanks for pointing me in the right direction!

Nancy
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,633
Members
452,933
Latest member
patv

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top