Using open file command in MS Access Form

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

Guest

I'm trying to import data into Access using a Form. The import in VB is straight forward. I want to be able to specify the file at run time. Ideally, I would want to display a drop down menu like when a file is opened from the menu bar. I can't find the series of commands I need to give. Any suggestions?
 
knowsgrace said:
I'm trying to import data into Access using a Form. The import in VB
is straight forward. I want to be able to specify the file at run
time. Ideally, I would want to display a drop down menu like when a
file is opened from the menu bar. I can't find the series of
commands I need to give. Any suggestions?

You mean you want to use a standard Windows "Open File" dialog? If
you're running Access 2002 or later, you can use the
Application.FileDialog method -- I believe you'll need to set a
reference to the Microsoft Office 10 Object Library. If you're using
Access 2000 or earlier, or if you just want to be compatible with them
or to have a bit more control, you can call the Windows File Open/Save
API directly using the code found here:

www.mvps.org/access/api/api0001.htm
 
In the book "Access 2000 Developer's Handbook" by Ken Getz, publisher SYBEX;
there is a great class module for "Open File" dialog. It is very flexible,
reliable, and works great. The ActiveX control "Open Dialog" works great
too.

Cheers,
Henry
 
Henry Smith said:
In the book "Access 2000 Developer's Handbook" by Ken Getz, publisher
SYBEX; there is a great class module for "Open File" dialog. It is
very flexible, reliable, and works great.

That's not surprising, considering Ken Getz wrote the code I posted the
link to.
The ActiveX control "Open Dialog" works great too.

I'm not sure what ActiveX control you're referring to. The problem with
ActiveX controls in general is that you may encounter versioning
problems when installing your application on multiple workstations. If
you can't ensure that every user has and maintains the same version of
the OCX, your application is likely to be plagued by broken references.
The MS Common Dialog control is notoriously prone to these problems,
because many different applications install versions of this control,
frequently different from the one you installed with your own
application.
 
Back
Top