Can you Use StreamReader In Public Module / Function- I'm trying Loading Text Files In to a Combo Box

Ken808 used Ask the Experts™
Hi Guys,

I have a program I'm working on with multiple combo boxes on multiple forms. A lot of the combo boxes are labeled the same name. Ie ComboBox1.

Can you Use StreamReader In Public Module / Function

 I'm trying Loading Text Files In to a Combo Boxes. I have multiple forms with same combo boxes. I would like to reduce the amount of code im using...

This is an example of how im reading my text file in to the combo box.

   Dim objReader_TextFile1 As New System.IO.StreamReader("c:\\Text_Files\TextFile1.txt")
                    Do While Not objReader_TextFile1.EndOfStream

Or is there a better / different way of doing this?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Top Expert 2009
Not sure it would really reduce code to move it to a module, when you can do it in one line like this:

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial