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
32 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 119

Accepted Solution

by:
Rey Obrero 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 119

Expert Comment

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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…
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…

863 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

21 Experts available now in Live!

Get 1:1 Help Now