Solved

in access 2016 - open a browser aand select a file, the path shuld be saved in a field

Posted on 2016-10-26
3
47 Views
Last Modified: 2016-10-26
in access 2016 - I would like to create a button that upon clicking it, it will open the list of files allowing me to select the desired file, and at the same time, the system will insert the file location path into the field.
It should not run the file like a hyperlink button.
0
Comment
Question by:Moshe Singer
  • 2
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 41861032
try this codes, add the Microsoft Office 16.0 Object Library to your References
change Me.txtFullPath with the name of your Textbox

Private Sub cmdSelect_Click()
Dim fd As Object
Set fd = Application.FileDialog(3) 'msoFileDialogFilePicker
With fd
    .Filters.Clear
    .InitialFileName = CurrentProject.Path & "\"
    .Title = "Select File"
    .AllowMultiSelect = False
    .ButtonName = "Select"
    .Filters.Add "All Files (*.*)", "*.*"
    .InitialView = msoFileDialogViewList
    If .Show Then
        Me.txtFullpath = .SelectedItems(1)
        Else
        Exit Sub
    End If

End With
0
 

Author Comment

by:Moshe Singer
ID: 41861105
thanks a million, it works wondrfull
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 41861139
don't forget to close the thread, by accepting the post that resolve your problem
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

791 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