How to Use a File Dialog in MS Access to Allow Users to Pick a File or Folder

Поділитися
Вставка
  • Опубліковано 7 жов 2024
  • In this episode, we'll take a look at how to let users choose a file or folder in their file system in order to get the path so that we can use it in our application. This example will show how to allow for single or multiple file selections, and we'll put the file paths into a text file and show them in a message box.
    Related Videos:
    How to Use a File Dialog in MS Access to Allow Users to Pick a File or Folder
    You are watching this video now!
    How to Write a Custom Text File Using MS Access VBA
    • How to Write a Custom ...
    How to Integrate Machine Learning into Microsoft Access Applications
    • How to Integrate Machi...
    How to Use Base64 in Microsoft Access
    • How to Use Base64 in M...
    How to Use Sleep to Pause VBA in MS Access
    • How to Use Sleep to Pa...
    How to Open Excel from Access Using VBA
    • How to Open Excel from...
    How to Use vbScript to Open and Work with Data in Access accdb Files - Late Binding Example
    • How to Use vbScript to...
    Interested in transforming your career or finding your next gig?
    system.billzon...
    Needing to hire technical resources for your project? Get the best:
    www.toptal.com...
    Want to get access to premium content made just for you and have a chat with me? Find me on Patreon :
    / mackenziedataengineering
    Demo of my BZ RDP Cloaker:
    www.patreon.co...
    Want to work with me 1:1? Contact me today and book your free 20 min consultation!
    Contact form you can find at www.mackenziema...
    Follow me on social media:
    / mackenziedataanalytics
    / seamacke
    / seamacke
    / seamacke
    / psmackenzie
    Get Microsoft Office including Access:
    click.linksyne...
    Got a UA-cam Channel? I use TubeBuddy, it is awesome. Give it a try:
    www.tubebuddy....
    #msaccess #vba

КОМЕНТАРІ • 51

  • @interestingamerican3100
    @interestingamerican3100 2 роки тому +3

    Excellent explanation! UA-cam needs to promote more of this content.

  • @petewarby7158
    @petewarby7158 Рік тому +1

    Unreal. Without even knowing it this is exactly what i cab use in a Db i am making to track orders and finances for my wife's upcoming business. It's a fantastic way of my keeping the size of the Db down and making it easy for her to grab the images she wants to link to. Brilliant. Brilliant.

  • @GunnerEshzurale-ph7bc
    @GunnerEshzurale-ph7bc 11 місяців тому +1

    This is really a good concept for file browser/manager. I had incorporated this function into my database which enables me to upload the link for all the documents related to my client (contract, lpo, work order, etc)

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  11 місяців тому

      Nice! That's a great use for this function. Once you get it, it can automate so many things.

  • @felipescherer6678
    @felipescherer6678 Рік тому +1

    Simple and clear explanations. Thanks for sharing!

  • @colinmiles1052
    @colinmiles1052 Рік тому +1

    Truly brilliant! Just what I wanted to achieve. Thank you.

  • @josemariavicentetascon8428
    @josemariavicentetascon8428 2 роки тому +1

    Excellent tutorial. Thank you for Sharing your knowledge.

  • @miles6875
    @miles6875 Рік тому +1

    Very valuable topic, thanks Sean

  • @Ziahasan222
    @Ziahasan222 2 роки тому +1

    Thank you Sir.

  • @AReelLife
    @AReelLife 2 роки тому +1

    Nice video, well paced. I've been using SHBrowseForFolder and my bugabear is setting an initial directory.

  • @dbdata9836
    @dbdata9836 2 роки тому +1

    thanks Mr

  • @Alejandra-mu2ys
    @Alejandra-mu2ys Рік тому +1

    Great video!!!!!

  • @neilbarnes9004
    @neilbarnes9004 2 місяці тому +1

    Thanks

  • @pathtolightbd
    @pathtolightbd Рік тому +1

    Great tutorial on Access programming. Could you pls consider uploading a similar video on backing up the backend DB from within frontend ACCESS APPLICATION to a selected drive, folder and so on..Thanks

  • @dbdata9836
    @dbdata9836 2 роки тому +2

    10/10

  • @Craigybabes6
    @Craigybabes6 10 днів тому

    This is a great feature, thank you. How would you get the UNC filepath when selecting a file from a network drive. At the moment I just get the mapped drive letter.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  9 днів тому

      No problem! When you open the Dialog, try browsing to the file using the Network location instead of the drive letter.

  • @JCBrownVideos
    @JCBrownVideos Рік тому +1

    Excellent! Could you please explain how to get just the filename without the path to put in a field? Thank you.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Рік тому

      You can parse it out something like:
      strFile = .SelectedItems(1)
      arFile = Split(strFile, "\")
      strFile = arFile(UBound(arFile))
      strFile will just be the selected file name.

    • @JCBrownVideos
      @JCBrownVideos Рік тому

      @@seanmackenziedataengineering HI and thank you. In the meantime, I found another way, using the Dir function. So, Me!txtFile = Dir(.SelectedItems(1)) does the job. Dir returns just the filename without the path. I also noticed that exiting without selecting a file returned an error. I added in an If Then End If.

  • @stampap2551
    @stampap2551 Рік тому +1

    Great Video!!! Very helpful! Is there a way to extend this operation by having the ability to additionally copy the selected file to another folder of our choice? Thank you in advance!

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Рік тому

      Thanks for the feedback! Yes, you can, by using the FileCopy statement after selection, ie:
      FileCopy sourcefilepath, destinationfilepath

  • @dbdata9836
    @dbdata9836 2 роки тому +1

    great

  • @Ziahasan222
    @Ziahasan222 2 роки тому +1

    Sir how can i transfer my selected file to current project folder.. Plz do a video so we can learn more. Thanks you.

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 роки тому

      Using file dialog, you will get the file name. Then you can use FileCopy command to copy from your Dialog selected location to your project file location.

  • @RAVICHANDRANR-d6u
    @RAVICHANDRANR-d6u Місяць тому +1

    Where can we view the upload documents?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  27 днів тому

      The file dialog only returns the selected document. Only after you copy from one place to another do you see the upload.

  • @menkiz123
    @menkiz123 Рік тому +1

    How would I open the file I am picking from the above...using the path stored in the text file?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Рік тому

      You can use Application.FollowHyperlink strFilepath in order to open the file you found in file dialog. If Filepath has spaces in it, you may need to put quotes around it, using double double quotes or Chr(34). ie.
      Application.FollowHyperlink Chr(34) & strFilePath & Chr(34)

  • @MaraingMuong168
    @MaraingMuong168 Рік тому +1

    Dear Sir I want to learn Copy File Folder from one destination to another Destination in Access. please help to teach with this lesson Copy File

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Рік тому +1

      You can use FileCopy command in VBA. In a VBA Sub just type FileCopy then space and the IDE will tell you the options - Source file, Destination etc.

    • @MaraingMuong168
      @MaraingMuong168 Рік тому +1

      @@seanmackenziedataengineering Thank you Sir, Could you please 🥺 Teach by Creat Videos Step by Step for FileCopy Lesson ☺️

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Рік тому +1

      @@MaraingMuong168 I’ll put it on my list!

  • @andriyos_
    @andriyos_ Рік тому

    if click the button "Get File" and close the window without selecting a folder, then the error message "The expression you entered has an invalid reference to the Parent property" will appear. How to fix this error?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  Рік тому +1

      You can trap the error by putting error handling on the procedure. Determine which error number it is, then either disregard it or give a custom message: ua-cam.com/video/13aFUK7tmus/v-deo.html

    • @andriyos_
      @andriyos_ Рік тому

      @@seanmackenziedataengineering Thank you very much. it helped))