Solved

Making a Browse Button in Microsoft Access

Posted on 2001-08-02
4
199 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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…

813 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now