Solved

Making a Browse Button in Microsoft Access

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

20 Experts available now in Live!

Get 1:1 Help Now