General discussion

Locked

MsAccess 97- How do I get a file window?

By Cooger ·
I would like to get a file window open through MsAccess 97....any ideas?

What I actually need is for the user to be presented with a window from which he can a file and I will then grab the filename and location and link to it as a link table.Thanks...

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

MsAccess 97- How do I get a file window?

by Peyison In reply to MsAccess 97- How do I get ...

First, you need to include an instance of the Microsoft Common Dialog Control on your form. From the forms toolbox select the "More Controls" button (lower right). From the list of controls, select "Common Dialogs Control". Then click on your form to add it. This control will be hidden when the form is diplayed.

Next add the code to call the Open File dialog. In this example, the Common Dialog control is named cdDialog.

Private Sub cbtOpenFile_Click()
Dim sFileName As String

cdDialog.Flags = cdlOFNFileMustExist
cdDialog.Filter = "Access File (*.mdb)|*.mdb"
cdDialog.ShowOpen
sFileName = cdDialog.FileName
MsgBox sFileName
End Sub

You can also use this control to pop a "Save File" dialog (cdDialog=ShowSave), and Color, Font, Help and Printer dialogs (ShowColor, ShowFont, ShowHelp, ShowPrinter)

There are many flags available - like cdlOFNFileMustExist used above. If you have VB you can look in help for all of the options. If you don't, I can email the list of flags, and any examples from VB Help.

Hope this helps.

Collapse -

MsAccess 97- How do I get a file window?

by Cooger In reply to MsAccess 97- How do I get ...

Poster rated this answer

Collapse -

MsAccess 97- How do I get a file window?

by eSadacca In reply to MsAccess 97- How do I get ...

Rather than using a Common Dialog, use an API call. Check Dev's site at:
http://www.mvps.org/access/api/api0001.htm

Collapse -

MsAccess 97- How do I get a file window?

by Cooger In reply to MsAccess 97- How do I get ...

Poster rated this answer

Collapse -

MsAccess 97- How do I get a file window?

by Cooger In reply to MsAccess 97- How do I get ...

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums