Solved

Making a Browse Button in Microsoft Access

Posted on 2001-08-02
4
201 Views
Last Modified: 2008-02-01
Hi, How could I go about in making a browse button for a file, not a directory.
0
Comment
Question by:manly9004
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
mgrattan earned 50 total points
ID: 6345616
Here's a sample database that shows you various methods of using Windows Common Dialogs, including the Open File dialog that you want to use:

ftp://www.athree.com/pub/candace/candace/dialog/dialog.zip
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 6346469
what you need is to add the Windows Common DIalog Control to you Access Toolbox.  at the Botton Right corner of the tool box, click on the button that looks like a craoosed Hammer and Wrench.  That will  take you to a laong drop down list, that will show you ALL of the ActiveX (COM) controls that are currently installed on your Computer.  Scroll down the list to find the MicroSoft Common Dialog CXontrol.  Click on that line, and when you go back to your form, you can then place the control on the form.  It will appear as a small square control.  IT DOES NOT display at runtime.

Click on the control, and change its name (from ActiveXCtrl...) to CommonDialog

Then, in your code for the Browse button, On Click Event handler:

Private Sub cmdBrose_Click()
   Dim strFile as String
   CommonDialog.ShowOpen
   strFile = CommonDialog.FileName
   ' now add code to use that file path in some way
   ' perhaps addig it to a texct box
End Sub


0
 

Author Comment

by:manly9004
ID: 6348690
Prime example. Well done. Thanks a bunch.
0
 
LVL 14

Expert Comment

by:mgrattan
ID: 6349234
You're welcome.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question