List box that will display file names???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I think I need a list box.....maybe I need something totally different. This
is what I want to do:
Each night we get a .txt file. Each morning I load the .txt file(s) into a
table, using Get External/Import. Then via a form, the users can go a print
their reports. I would like to have a form that will list (listbox?) the
files (in a specific folder). Then the user the user could click on the file
they want to load, which would then load using the spec I set up. Then they
could go to their form and get their reports, with no intervention from me.

Is this even possible? Could there be a better/easier way to do something
like this? Please keep in my I do not know vba code. Any advice would be
greatly appreciated. Thanks :)
 
Hi Msanewbee,

This is certainly possible, but only using the Scripting.FileSystemObject in
code to the best of my knowledge.

Easier, would be to use the Common File Dialog. Still need some code but it
is simpler.

Check out http://www.mvps.org/access/api/api0001.htm

Don't get put off by the complexity of the code - the only bit you'll need
to write is very simple. Anyway, maybe this is the perfect excuse to start
learning!

Post again if you get stuck.

Ben.
 
A query like this could be used as the row source for a list box to return
all the table names in the database:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "Switchboard*") AND
((MSysObjects.Type)=1 Or (MSysObjects.Type)=6) AND
((MSysObjects.Flags)<>-2147483648));
 
Okay...I'm guilty. I don't have a clue. I looked at the api0001, but I'm
not sure which part of that I would need. I'm willing to try some code but I
don't even know where to put it. Could I have some more clues??
 
Have you seen Klatuu's answer? Could be a possibility...

To be honest with you the code to accomplish this is just plain going to be
complex. As I understand it you wish to have the user choose a text file
from a directory, which will then import to a specification which you've
created, and thus allow them to create reports etc... based on the data.

Maybe it would be easier to just have your users use Access themselves -
show them how to choose file->get external data and navigate to your text
file directory. Essentially this is the exact functionality that you've
described!

Is there a reason this would be insufficient?

Ben.
 
Yes, I did see that answer, but didn't understand that one either. (I know, I
have a lot to learn)
I don't think my users can load a table because they only have read-access.
We have very few licenses here. You'd probably die laughing if I told you
what it took to get mine!! :)

Yes, you understand what I wanted to do. It just seemed like it should be
an easy thing. I guess I'll have to try a different plan.
Thanks :)
 
Back
Top