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

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 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 TH-cam Channel? I use TubeBuddy, it is awesome. Give it a try:
    www.tubebuddy....
    #msaccess #vba

ความคิดเห็น • 51

  • @RAVICHANDRANR-d6u
    @RAVICHANDRANR-d6u 27 วันที่ผ่านมา +1

    Where can we view the upload documents?

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  20 วันที่ผ่านมา

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

  • @Craigybabes6
    @Craigybabes6 4 วันที่ผ่านมา

    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  3 วันที่ผ่านมา

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

  • @neilbarnes9004
    @neilbarnes9004 2 หลายเดือนก่อน +1

    Thanks

  • @interestingamerican3100
    @interestingamerican3100 2 ปีที่แล้ว +3

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

  • @GunnerEshzurale-ph7bc
    @GunnerEshzurale-ph7bc 10 หลายเดือนก่อน +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  10 หลายเดือนก่อน

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

  • @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)

  • @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.

  • @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

  • @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

  • @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.

  • @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!

  • @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.

  • @AReelLife
    @AReelLife 2 ปีที่แล้ว +1

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

  • @colinmiles1052
    @colinmiles1052 ปีที่แล้ว +1

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

  • @dbdata9836
    @dbdata9836 2 ปีที่แล้ว +2

    10/10

  • @josemariavicentetascon8428
    @josemariavicentetascon8428 2 ปีที่แล้ว +1

    Excellent tutorial. Thank you for Sharing your knowledge.

  • @miles6875
    @miles6875 ปีที่แล้ว +1

    Very valuable topic, thanks Sean

  • @felipescherer6678
    @felipescherer6678 ปีที่แล้ว +1

    Simple and clear explanations. Thanks for sharing!

  • @Alejandra-mu2ys
    @Alejandra-mu2ys ปีที่แล้ว +1

    Great video!!!!!

  • @Ziahasan222
    @Ziahasan222 2 ปีที่แล้ว +1

    Thank you Sir.

  • @dbdata9836
    @dbdata9836 2 ปีที่แล้ว +1

    thanks Mr

  • @dbdata9836
    @dbdata9836 2 ปีที่แล้ว +1

    great

  • @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: th-cam.com/video/13aFUK7tmus/w-d-xo.html

    • @andriyos_
      @andriyos_ ปีที่แล้ว

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