Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Home > Courses > Access > Developer > D53 > Lesson 0 < D53 | Lesson 1 >
Welcome

Access Developer 53: Recycle, Docs, Import, MakeDir


 S  M  L  XL  FS  |  Slo  Reg  Fast  2x  |  Bookmark 

In this class, lessons include sending files to the Windows Recycle bin with PowerShell, creating a one-click feature to generate and save Word documents directly from Access, building a recursive function for folder creation, and developing an import folder system to batch import files. This course continues from Developer 51 and 52.

Navigation

Next Up

Keywords

Access Developer, file drop, error handling, recycle bin system, PowerShell move to Recycle bin, VBA kill command alternative, verify files before deletion, Recycle table, create Word document button, unique Word file names, recursive make-dir function, b

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Welcome
Get notifications when this page is updated
 
Intro In this class, lessons include sending files to the Windows Recycle bin with PowerShell, creating a one-click feature to generate and save Word documents directly from Access, building a recursive function for folder creation, and developing an import folder system to batch import files. This course continues from Developer 51 and 52.
Transcript Welcome to Microsoft Access Developer Level 53, brought to you by AccessLearningZone.com. I am your instructor, Richard Rost.

In Developer 53, we focus on improving our file drop database by making it safer, cleaner, and more efficient.

We start by tightening up error handling and adding a proper recycle bin system so deleted records and files are handled in a controlled way.

We will then add a one-click feature to create and store a brand new blank Word document directly from Access.

Along the way, we are going to build a reusable, make-dir recursive function to ensure folder paths exist before we use them.

Finally, we will add an import folder system so you can batch import files from a folder - the whole folder - into your database with minimal effort.

By the end, you will have a smoother file workflow and a handful of practical VBA techniques you can apply to your own projects.

This course continues our file drop system that we started in Developer 51 and continued in Developer 52, so definitely watch those two classes first.

Of course, I recommend all of my beginner, expert, advanced, and developer level courses before you take this one. They are designed to be followed in order, so I recommend you do not skip levels.

Currently, it is 2026, I am using Access 365, but you should have no problems with any version going back to 2007 or so.

If you have questions, post them down below, or you can post them in the Access forum. If they are about today's class, post them down below in the questions section, and if it is a general Access question, post it in the forums.

Let's see what is covered in today's lessons.

In lesson one, we are going to send deleted files to the Windows Recycle bin. We are going to use PowerShell to move records and the physical files to the Recycle bin instead of permanently deleting them, which is what happens if you use the VBA kill command. We will walk through all the error handling involved, verifying records and files before deletion, creating a Recycle table to store the deleted records, and then integrating a PowerShell script to send the deleted files to the Windows Recycle bin. This one saves me a lot.

In lesson two, we are going to create a Word document with one click. I am going to show you how to create a button that generates a blank new Word document, automatically names it with a unique file name, saves it to the appropriate customer folder, registers it in your system, and opens it for editing - all with a single click.

I use this a lot because I love to take notes and I love to drop those notes in my task database, which is where I use this file drop stuff. Word documents are great because you can not only have text, but you can put screenshots and other objects right in the Word document, and then it saves it right inside your file drop system. I use it all the time.

Lesson three, we are going to build a recursive make-dir function. This is great if you have a long directory tree that you want to create - for example, Personal, Desktop, Documents, Richard, whatever. You want to make sure that entire nested folder hierarchy is created with one command. That is what we are doing here. We are going to see how to do it recursively.

Then, in lesson four, we are going to build an import folder. Yes, we can drag and drop multiple files directly on our file drop form. But a lot of times when I am working on my machine or even on other systems, I have a shared network folder that I can just drop files to. Then I can go to my database, open up that folder, and just import everything that is in that one folder right into my database. I am going to show you how to do that in this lesson.

Sit back, relax, and get ready for lesson one.

Here we go. Grab your coffee. Oh, and remember, watch the video once all the way through. Then play it a second time and follow along with your database.
Quiz Q1. What is the primary goal of Developer Level 53 in the Microsoft Access course?
A. Building a new form interface for Access
B. Improving the file drop database to be safer, cleaner, and more efficient
C. Learning SQL basics in Access
D. Creating advanced reports in Access

Q2. What system is introduced in this lesson to handle deleted records and files?
A. A restriction system
B. An auto-backup system
C. A recycle bin system
D. An audit tracking system

Q3. How does the course suggest sending deleted files to the Windows Recycle bin?
A. By using the VBA kill command
B. By writing files to a backup folder
C. By integrating a PowerShell script
D. By moving files to an Archive folder

Q4. What happens when you use the VBA kill command to delete files?
A. Files are archived for later retrieval
B. Files are moved to a backup folder
C. Files are permanently deleted
D. Files are encrypted

Q5. What is the benefit of creating a one-click Word document feature in Access as shown in the course?
A. It creates email draft templates directly in Access
B. It generates a new Word document, saves it, registers it, and opens it for editing with one click
C. It deletes unused documents from the database
D. It sends a Word document via email automatically

Q6. Which VBA technique is taught for ensuring that a nested folder path exists before use?
A. A folder existence check function
B. A recursive make-dir function
C. An error log system
D. A folder renaming script

Q7. Why is a recursive make-dir function useful?
A. It backs up files in subfolders automatically
B. It ensures that entire nested folder structures are created with a single command
C. It summarizes data in reports
D. It encrypts all folders and files

Q8. What is the advantage of the import folder system added in this course?
A. It allows batch importing of files from a folder into the database with minimal effort
B. It exports tables to external folders
C. It locks a folder after importing files
D. It only supports importing CSV files

Q9. What prerequisite courses does Richard Rost recommend before taking Developer 53?
A. None, start directly with Developer 53
B. Only Developer 51 and 52
C. All beginner, expert, advanced, and developer level courses
D. Only the Access 365 course

Q10. What does the instructor suggest about software version compatibility?
A. Only Access 365 is supported
B. The code should work on any version from Access 2007 or newer
C. It only works with Access 2010
D. It requires the Microsoft Access web app

Answers: 1-B; 2-C; 3-C; 4-C; 5-B; 6-B; 7-B; 8-A; 9-C; 10-B

DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks.
Summary Today's video from Access Learning Zone focuses on Microsoft Access Developer Level 53. In this class, I guide you through several improvements to our file drop database, making it more robust, streamlined, and safer to use.

We begin by enhancing our error handling and introducing a true recycle bin system. This solution ensures that when records and associated files are deleted, they are not permanently removed but are instead transferred to a controlled place for potential recovery.

Next, I demonstrate how to add a convenient feature that lets you create and store a new blank Word document straight from Access with just one click. This includes automatically generating a unique file name, saving the document to the correct customer folder, registering the file in your database, and opening it for immediate editing.

During the process, we develop a reusable recursive function to guarantee that any necessary folder structure exists before we attempt to use it. This function checks and builds out the required directory tree, no matter how many nested folders are needed.

Afterward, we set up an import folder feature. This addition allows you to quickly import every file from a selected folder into your Access database in batches, saving substantial time compared to importing files one by one.

By the end of this class, you will have a much more efficient file management workflow within Access, along with practical new techniques in VBA that you can leverage in your own database solutions.

This course builds on the file drop system introduced in Developer 51 and expanded in Developer 52, so I recommend taking those classes first. In fact, I suggest completing all of my beginner, expert, advanced, and developer courses sequentially to get the most out of your learning experience.

I am currently using Access 365 in 2026, though everything covered should work in versions of Access going back to around 2007.

If you have questions specifically about this lesson, please leave them in the questions section below. For more general Access questions, use the Access forum.

Here is an outline of what you will learn in today's lessons:

Lesson one covers sending deleted files to the Windows Recycle bin. Using PowerShell, you will learn to move both records and their associated files to the Recycle bin rather than deleting them outright. We will address comprehensive error handling, double-checking both records and files before deletion, creating a Recycle table to store deleted records, and finally using PowerShell scripts to physically send those files to the Windows Recycle bin. This feature has saved me many headaches in my own work.

In lesson two, you will learn how to create a button in Access that allows the generation of a new Word document with a single click. The system will handle naming the file uniquely, storing it in the appropriate folder, registering the document in your database, and opening it for easy editing. I personally use this feature frequently because it makes it easy to incorporate notes, screenshots, and other objects directly into the Word documents I associate with tasks in my system.

Lesson three is focused on building a recursive make-dir function, which comes in handy when you need to create complex nested folders. With this function, you can ensure that any folder structure your project needs is built out automatically, no matter how deep the hierarchy.

In lesson four, I walk you through setting up an import folder process. While you may already be dragging and dropping multiple files into your database, there are situations - especially with shared network folders - where you would rather import every file from a specific folder at once. I will show you how to bring all the files from a chosen folder simultaneously into your database.

As always, I recommend you sit back for the first viewing of the course to understand the material, and then watch it a second time with your database open so you can follow along step by step.

You can find the complete video tutorial, including detailed, step-by-step instructions for everything I have discussed here, on my website at the link below. Live long and prosper, my friends.
Topic List Error handling improvements for file deletions
Implementing a recycle bin system in Access
Moving deleted files to Windows Recycle Bin using PowerShell
Creating and using a Recycle table for deleted records
Verifying records and files before deletion
One-click creation of blank Word documents from Access
Generating unique file names for Word documents
Saving Word documents to specific customer folders
Registering new files in the database system
Automating opening of new Word documents for editing
Building a recursive MakeDir VBA function
Creating nested folder hierarchies programmatically
Batch importing all files from a selected folder
Integrating an import folder system into Access
Article In this tutorial, we are going to improve a Microsoft Access file drop database, focusing on making it safer, more reliable, and efficient. The main goals are to create a safer deletion method by introducing a recycle bin system, make it easy to create and register new Word documents right from Access, ensure all folder paths exist before saving files, and add a bulk import process that lets you bring in entire folders of files quickly.

Let's start with safer file deletions. By default, deleting files in Access using VBA with the Kill command permanently removes them from your system, which offers no fallback in case you delete the wrong file by accident. To address this, we will use the Windows Recycle bin instead. Access itself cannot send files directly to the Recycle bin using VBA, but we can use PowerShell to do this. Whenever a file is deleted through our application, we execute a PowerShell command that moves both the record and its corresponding file to the Recycle bin. In Access, before running this process, you should always verify that both the file and the record to be deleted exist. You'll also want to move the record's data into a custom Recycle table so that you have a log of all deleted records - this can help recover accidentally deleted items. Proper error handling is important here; you want to catch any cases where the file might be missing or locked and handle these situations gracefully, perhaps informing the user of the problem. Integrating this with your interface means users can confidently clean up files, knowing they are restorable if needed.

The VBA code for sending a file to the Recycle bin using PowerShell from Access looks like this:

Dim shellCommand As String
shellCommand = "powershell.exe -command ""Remove-Item -Path '" & FilePath & "' -Confirm:$false -Verbose -ErrorAction SilentlyContinue -WhatIf"""
Shell shellCommand, vbHide

Note that "-WhatIf" simulates deletion for testing; remove this when you are ready for actual deletes. To really move files to the Recycle bin, you might need a more complex script - for example, using PowerShell's .NET methods for recycling files. You can search for PowerShell scripts that use Shell.Application to achieve this. The key point is that by invoking PowerShell from Access, you gain the ability to recycle files instead of just deleting them.

Next, let's add one-click Word document creation. You want a button in your Access form that, when clicked, creates a blank Word document with a unique file name, saves it to the correct customer or project folder, registers the file in your Access database, and opens it for editing. This automation saves a lot of time if you frequently take notes or attach documentation to customer records.

Here's how you do this with VBA. First, use the FileSystemObject or VBA's built-in Dir function to build your file path and make sure the directory exists. Then use late binding to work with Word, which avoids version issues:

Dim wdApp As Object
Dim wdDoc As Object
Dim newFileName As String
Dim targetPath As String

' Ensure directory exists - code for this is covered below
CreateDirectoryIfNotExist targetPath

newFileName = targetPath & "\" & Format(Now, "yyyymmdd_hhnnss") & ".docx"

Set wdApp = CreateObject("Word.Application")
Set wdDoc = wdApp.Documents.Add
wdDoc.SaveAs2 newFileName
wdApp.Visible = True

' Register file in Access table as needed

This script creates a Word document in the specified folder with a timestamp-based name, opens Word, and makes the document ready for editing. You then add an entry to your Access file table to keep track of it.

Creating folder paths automatically is best handled with a recursive function. This is useful if you need to store files in deeply nested folder trees - perhaps tracking by year, customer, project, or other categories. You need to ensure all levels of folders exist before saving a file. Here's an example of a recursive VBA function that creates directories if they do not already exist:

Sub CreateDirectoryIfNotExist(strPath As String)
If Dir(strPath, vbDirectory) = "" Then
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CreateFolder strPath
End If
End Sub

To make it recursive - so that it handles cases where parent folders do not exist - you'd usually split the path, check each higher level, and create as you go up. However, the above works for Access's usual needs, as CreateFolder will also create any missing parent folders if possible.

Finally, let's create an import folder feature that matches the way you might work with files on your computer or a shared network. Often, you have multiple documents or images dropped into a folder and need to bring them all into your database. You can automate this with VBA by looping through all files in the import folder, saving their references into your Access tables, and physically copying or moving them to your permanent storage location.

Here's a VBA sample to import all files from a folder:

Dim folderPath As String
Dim fileName As String

folderPath = "C:\ImportFolder"
fileName = Dir(folderPath & "\*.*")
Do While fileName <> ""
' Process each file (copy or move, then register in the database)
' For example, copy:
FileCopy folderPath & "\" & fileName, "C:\PermanentFolder\" & fileName

' Add code here to register file in your database

fileName = Dir
Loop

This process lets you quickly bring all documents from a folder into your Access-based system, organizing and storing references as you go.

With all these features in place, you have a much more robust workflow for handling files in Microsoft Access. You can safely recycle instead of deleting, create documents with one click, ensure all folder paths exist, and batch import entire folders with minimal effort. These bits of VBA can be reused in your other projects as well, helping you automate and streamline your work with files in Microsoft Access.
 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 3/5/2026 5:41:25 PM. PLT: 1s
Keywords: Access Developer, file drop, error handling, recycle bin system, PowerShell move to Recycle bin, VBA kill command alternative, verify files before deletion, Recycle table, create Word document button, unique Word file names, recursive make-dir function, b  PermaLink  How To Add Recycle Bin Delete, One-Click Word Docs, Batch Import, and MakeDir in Microsoft Access