Wednesday, March 11, 2026

How to Filter a Microsoft Access Subform With a Combo Box

Are you tired of hopping around to different forms in your database just to see when you last contacted a customer? If it seems like you're jumping through digital hoops just to get to your customer's history, let's make your life easier. Today, I'm going to show you how to streamline your workflow by setting up a form where you can instantly filter and view one customer's contact history - just by selecting their name from a combo box. Simple, fast, and no more wild goose chases.

The goal here is to give you one easy-to-use form. You pick a customer from a dropdown, and right below, you instantly see only that customer's contacts. This trick will cut out all the back-and-forth between forms, letting you focus on your customers, not your screen. And, yes, it's going to save you a ton of clicks and time - especially handy if you're always switching between different contacts all day long.

Let's dive in. For this demo, I'm using the TechHelp free template database, which you can grab from my website if you want to follow along. Normally, finding a customer's contacts might involve opening the customer form, searching for your person, and then launching the contacts form for their history. Functional, but far from efficient.

So, what's the trick? We're going to build what's called an "unbound parent form." Think of it as a blank canvas - with no inherent data - where you'll drop in a combo box linked to your customer table. You'll also drop in a subform that displays your contacts. When you pick a customer from the combo box, the subform magically filters to just their records.

To make this happen, you need a combo box populated with your customers. The best approach is to use a query that combines first and last names, so your dropdown list looks neat and is easy to search. You can use a concatenated field, like "LastName, FirstName," as the display value in your combo box. Go wild - make sure your combo box lists your customers alphabetically for quick access.

Once you've set up your combo box and subform, you need a way to connect them. There are two ways to approach this: a VBA-free method using "Link Master Fields" and "Link Child Fields" properties, and a slightly more advanced method with a tiny bit of VBA code. (Don't worry - it's literally two lines!)

If you're a non-programmer or just want something super quick: set the subform's Link Master Fields to reference your combo box (for example, "CustomerCombo") and Link Child Fields to the "CustomerID" in your contact records. With this setup, when you pick a customer, the subform filters accordingly. The drawback? The form will appear blank when first opened, since there's no customer selected yet. Also, you can't easily display all contacts at once if you need to switch between filtered and unfiltered views.

For more flexibility, a few lines of VBA comes to the rescue. Here's what you do: Head to your combo box's properties and tap into the "After Update" event. When that event fires (meaning whenever you pick a new customer), you set the subform's filter so it shows only contacts matching that selected customer. This lets you see everyone by default, then narrow it down instantly based on your choice. Want to review all contacts across all customers? Just clear the combo box filter. This VBA method is neat, professional, and gives you control for making future tweaks.

Just remember, naming matters! Make sure your subform control and your combo box have clear, unique names. Sometimes Access uses the form's caption in place of its actual name, which can break your code if you're not paying attention. Always double-check you're referencing the correct objects in your event properties.

As with most things in Access, there are always extra details to smooth out. For example, you'll want to handle scenarios where the user clears the combo box, or when adding a new contact while filtered - it's possible to end up with new records awkwardly unassociated with a customer. These special considerations, including tricks on how to decide where default values should come from, are covered in more detail for members in my extended cut video.

Want to take your database navigation to the next level? Consider diving into search and sorting videos as well as more advanced topics, like multi-select list boxes if you ever want to filter for multiple customers at once. The world of Access is big, and once you've mastered filtering with combo boxes and subforms, you'll wonder how you ever lived without it.

Remember, for a complete look at the actual VBA code and an in-depth walkthrough, check out the video embedded above. Whether you stick with the no-code method or tiptoe into VBA, this is a huge time-saver that adds real usability to your Access applications.

Live long and prosper,
RR

Tuesday, March 10, 2026

Answering Student Questions From SQL Server for Microsoft Access Users Beginner Level 1

Let's face it: when you start sharing Microsoft Access projects with others (or just get nosy about the "backend stuff"), it's only a matter of time before you wonder about SQL Server, authentication, or which combo box is about to make your hair go gray. In this lesson, I'm diving into some of the most common (and quirky) questions that have rolled in from students as we've progressed through Beginner Level One. Whether you're stuck on connection strings, confused over which edition of SQL Server to install, or just want to know if your Access forms are ever going to run faster, you'll find some solid answers here.

If you've been following along, you know there's no shortage of SQL Server editions and possible ways to connect Access to it. Sometimes, just picking Express or Developer feels like a pop quiz from Microsoft. But don't sweat it. We'll get right into why certain authentication methods are safer (and easier), how to keep your forms from loading like it's 1999, and a whole lot more. We'll break down real-world mistakes, practical tips, and a few myths along the way.

Let's kick things off with one of the most popular questions that's come up: passwords and authentication. Many folks wonder, "If SQL Server authentication isn't secure, why not use code to prompt for the password at runtime and never store it?" And yes, with some crafty VBA (see the video for code details), that's possible - you can keep credentials out of your database file entirely. The catch? This approach demands some real programming skills and custom login forms, so it's not what I recommend for beginners just getting their feet wet. For now, sticking with Windows authentication is simple, clean, and keeps your users' passwords where they belong - in Windows, not scattered inside your Access file.

Next up, let's clear the air on the jungle of SQL Server editions. The main differences boil down to cost, features, and what you actually need. SQL Server Express is free, easy to install, and perfect for learning or small office applications (think: up to 10GB per database, way more than Access could ever comfortably handle). Developer Edition is also free but is meant for, you guessed it, development - not production. Then you've got Standard and Enterprise for deep-pocketed corporations, and Azure SQL if you'd rather let Microsoft's cloud do your heavy lifting. For anyone following this course, Express is more than enough; you'll rarely hit its limits if you're comfortable with what Access already gives you.

I also get questions about the "Customer Since" field defaulting to DateTime2(7). That's just SQL Server flexing its accuracy muscles - seven decimals of seconds when, realistically, most of us just need a date. If you're only collecting a date, using the DATE type is fine. But keep in mind: Access naturally works with date and time together, and this sometimes leads to confusion, especially with filtering queries using BETWEEN. Remember, BETWEEN on a DateTime field is literal: it looks at both date and time, so if you want records through the end of a day, you need to specify the cutoff (see my video for more details on that gotcha).

What about running SQL Server on Linux or a NAS? Technically possible, but for most Access developers, Windows is where you're going to get the smoothest ride and best support. SQL Server is fundamentally a Windows service - don't expect to run it from a network drive or dump it onto a NAS. For small setups, even an older PC or laptop does fine as a dedicated SQL Server box. You don't need anything fancy, and most importantly... don't bother trying to future-proof. Technology moves fast and "future proof" just means "trust me, you'll upgrade this in a couple years anyway."

I often get asked why you'd use Access at all if SQL Server can handle your data. Simple: SQL Server is a backend. It stores, safeguards, and processes the data. It doesn't build front-end forms or reports or let your users click shiny buttons. That's where Access shines as your front end, handling all the user interface work while SQL Server does the heavy lifting in the background.

If you're a solo developer or just testing things out, Express or Developer Edition of SQL Server is plenty. No need to pay for the big enterprise cuts until you're sure you need those options. For eight or fewer users, even a modest, off-the-shelf PC with a solid state drive can act as the SQL Server host. 16GB of RAM, a decent CPU, that's it. SQL Server doesn't chew up nearly as many resources as you might think for these use cases.

What about SSD wear thanks to all those transaction logs? You might have heard that SQL Server constantly writing logs will burn out your SSD. Don't lose sleep over it - modern SSDs handle this level of activity just fine. And you should never turn off transaction logging, as it's critical for data integrity and recovery. Just remember to periodically back up and occasionally maintain those log files.

One of the most common frustrations when linking Access to SQL Server: slow-loading forms packed with combo boxes. Each combo box runs its own query to fill up the dropdown, and when those hit SQL Server across a network, things can get sluggish. The fix: keep those combo box row sources tight, only include what you need, and, for complex lists, implement cascading combos so the form loads small sets of data at a time instead of everything at once. (Check out my video on optimizing combo boxes for more on this - you'll see a night-and-day difference in performance.)

Filtering SQL Server data from Access forms is not only possible, it's recommended! Instead of pulling every record into Access and then narrowing it down, pass your filter criteria directly to SQL Server via parameterized queries or pass-throughs. This way, all the chewing on data happens on the server, and you're only moving what you need over the network.

Wondering about moving 20+ Access tables into SQL Server? No, you don't need to do it by hand one painful table at a time. Tools like SQL Server Migration Assistant (SSMA) for Access, and the built-in Import and Export Wizard in SSMS, can take care of most of the grunt work. It's worth building a table or two by hand just to learn, but those tools exist for real migrations.

On permissions: should you set them for each user or use groups? Use groups whenever possible - assign a set of permissions to a group (like Accounting or Sales) and add or remove users as needed. It keeps things so much simpler, especially in bigger environments.

If you get stuck or something seems wonky - like Access demanding "unique record identifiers" during table linking - don't just click through. Think for a second about which field is really the unique identifier. Sometimes, a mistake here just means a more complex query behind the scenes (nothing explodes), but it's better to be precise.

And about SQL dialects: SQL Server's flavor is much closer to the global ANSI SQL standard than Access's. So as you move more into SQL Server, you'll notice your SQL looks less... quirky. Less jet/ACE "creative license," more standard-compliant statements.

Finally, don't overthink upgrading to SQL Server if you're a true single user, working on one PC. Access alone is perfectly fine as long as you can fit your data and performance needs. The benefits of SQL Server - improved security, networking, and multi-user handling - really become apparent when your database needs grow or when multiple machines need shared access.

As always, I appreciate everyone who's sent in questions and feedback; it helps me tailor the lessons to what's actually tripping people up. If you want to dig into any of these topics (especially the code-related ones), check out the video above for real-world demos, extra tips, and my usual "live bug-finding" style. Keep those questions coming and keep learning!

Live long and prosper,
RR

How To Handle Split Transactions and Multiple Categories in Microsoft Access Check Registers

Ever tried to assign a single financial transaction to multiple categories, only to realize your database design simply can't handle it? If so, you're certainly not alone. This is one of those classic stumbling blocks in database design that nearly everyone faces at some point - especially if you're using Access for any real-world financial tracking. Let's dig into why this problem arises, why just adding more category fields isn't the answer, and how the right table design can save your sanity.

Imagine this: you've built your first check register table in Access. You've got a spot for the date, the description of the transaction, the amount… and a category field. Feels straightforward, right? Rent, office supplies, utilities - they each get a neat little category ID. But then reality comes knocking. Suddenly, you've got a utility bill that's partly personal, partly business, or a mortgage payment that covers principal, interest, taxes, and insurance all in one chunk. Now that single category field in your transaction table feels like it's fighting a losing battle.

Here's the rub: real transactions don't play by the one-category-per-record rule. Sure, if your needs are super basic, a single category field works. But in the real world (especially if you're tracking stuff for your business or if you want to categorize your expenses accurately for taxes), transactions often need to be split into multiple pieces, each assigned to a different category. Classic accounting software like QuickBooks handles this, but many homegrown Access databases hit a wall.

If you try to sidestep the problem by sprinkling your table with Category1, Category2, Category3 fields, you'll quickly run into a maintenance nightmare. Every time you need "just one more" split, you end up redesigning your table - and that gets old fast. Plus, reporting on this tangled mess is virtually impossible.

So what's the secret? It's all about using a split table. Think of your main transaction table as the place where every real-world payment or deposit is recorded: date, description, amount, all the basics. Then, behind the scenes, you set up a related splits table - kind of like the order details in a sales database. Each split record links back to its parent transaction and holds its own category and amount.

For example, a $3,000 mortgage payment in your transactions table can hook into multiple splits: one for principal, one for interest, a couple more for taxes and insurance. Each split gets a category and the piece of the payment that goes with it. Or maybe your electric bill needs to be divided so a percentage is allocated as a business expense and the rest is personal. It's the same deal - one payment, any number of splits, each with its own category. No more awkward extra fields, no more redesigns every time something changes.

All you need is a simple one-to-many relationship between your transactions and splits. The main transaction table holds the source information, and the splits table breaks down each transaction as needed. When you build your forms, you can even use a subform to show and edit the splits right on the transaction screen. Lock down editing if you want to keep things simple, and offer a pop-up "Edit Splits" button for power users who want to fine-tune where the money goes.

This design has an extra bonus: your reporting gets much easier. When it's tax time or you want to see exactly what you've spent on office supplies versus owner draws, your reports just run on the splits table. You get rock-solid, accurate breakdowns - no more guesswork or questionable "other" categories.

So, the big moral of the story: if you ever need a transaction to cross over into multiple categories, don't try to cram extra category fields into your transactions table. Use a split table instead. It's neater, scales beautifully, and unlocks way more reporting power - plus, you'll avoid that "I have to redesign my database again" headache every time your finances get a bit more complex.

If you want step-by-step help, check out my check register video series for how to get started, my relationships video for setting up those crucial links, and my subforms tutorial for building the form interface. For a deep dive into split transactions, with all the bells and whistles, take a look at my Access Developer Level 54 class. The details - including handling percentages and rollback features - are all in there.

Questions, ideas, or database disaster stories? Drop a comment! And as always, the video above is there if you want a full walkthrough of everything we've covered today.

Live long and prosper,
RR

Sunday, March 8, 2026

How Changing Clocks Causes Problems and Why Daylight Saving Time Is Dumb for People and Software

Ah, yes. It's that time of year again where, for absolutely no rational reason, society collectively pretends the planet is suddenly spinning at a new speed and we all have to scurry around fixing clocks. Daylight saving time: the gift nobody asked for, but the burden we're all forced to carry. Twice a year, we're all running around like we're in a low-stakes action movie, smacking buttons on microwaves and car dashboards like we're defusing bombs. Somewhere, a digital clock blinks "12" in eternal protest. And honestly? I'm starting to admire its tenacity.

Let's be honest - no matter how many smartphones and smartwatches you own, there's always some rogue appliance in your house still living in the wrong century. If you've ever finished resetting all your gadgets only to discover the VCR is flashing "12:00" (and you don't even have any tapes left), welcome to the never-ending daylight saving struggle. It's like an involuntary scavenger hunt, and nobody gave you a map.

So, why do we do this? Why, in a high-tech world, do we all ritualistically adjust time as if the sun cares? It's not even a global effort - Arizona and Hawaii noped out ages ago, living life on their own time. Meanwhile, the rest of us are stuck waiting for Congress to get its act together. Florida even passed the so-called Sunshine Protection Act to keep daylight saving time year-round. Everyone cheered, and then… nothing happened. Because, surprise! You can't just stop the clock games without federal approval.

Even with bipartisan agreement - it's hard to find something both sides of Congress can agree on, but screwing up our sleep cycles is a rare unifier - we're still at the mercy of inertia in Washington. President Trump even said he supported ditching the twice-yearly time shift. Yet here we are, still wondering what time it really is twice a year, every year.

All this fuss wouldn't even be that bad if it had any real benefit. The idea originally popped up in 1908 in Germany and Austria to save fuel during the war. The U.S. codified it in the Uniform Time Act of 1966. Contrary to popular belief, this wasn't to help farmers - the ag industry lobbied against it. Actual quote: they hate it. So, the "think of the farmers" excuse? Myth. Busted.

In practice, daylight saving time screws up everything. Your sleep? Toast. Your sanity? Shot. In the days right after the switch, heart attack rates go up and productivity crashes. Trying to keep IT systems and databases in sync with actual time versus time on the clock? Good luck. Just ask any poor soul who had to debug scheduling software during a DST changeover. (And yes, even Apple messed it up. iPhone users will remember the clock glitch - a rare victory for Android fans.) If you use Excel or Access to track work hours, the safest route is using UTC (Universal Time), also known as Greenwich Mean Time, for all your records. That way, you won't have to explain why time appears to jump or repeat itself in your spreadsheets.

Of course, it's not just about computers. Resetting the oven, car, coffee maker, and wall clocks every time is just tedious - and there's always one you forget. Honestly, for a week or two each year, I just give up and mentally add or subtract an hour every time I look at the clock. The VCR is my nemesis, but at least it doesn't talk back (yet).

So what can you actually do about it, other than grumble? You can write to your congressperson. Yes, it's as exciting as it sounds, but if enough of us do it, maybe something will change. Want to make your voice heard? Google "write to my congressman." Input your zip code, find their contact page, fill out the form, and tell them how dumb the whole thing is (politely, of course). If you need inspiration, I've already written a letter - you're welcome to copy it and personalize it to your liking.

While we're at it, let's get ambitious. Not only does the world need to standardize dates (year, month, day - just do it already), but maybe it's time to consider adopting the metric system, a 28-day calendar, and giving New Year's Day its own holiday outside the calendar. Make Election Day the leap day and give everyone a day off to vote. I mean, why stop at clocks when there's so much more to fix?

Long story short: daylight saving time is pointless, outdated, and disruptive. The solution isn't changing clocks, but just changing what we do. If it's too dark for the kids in the morning? Start school later. Want more sun after work? Start earlier. Golfers concerned they'll miss the 18th hole before sunset? Tee off sooner. It's way easier than wrangling with Congress.

And yes, if you've got a clever meme about daylight saving time, send it my way - I love seeing them, and the best ones just might end up in my next video update.

For the full, ever-expanding director's cut of my "daylight saving time is dumb" rant, check out the video above. In the meantime, keep spreading the word, write your representatives, and maybe - just maybe - one day we'll stop this temporal madness for good.

Live long and prosper,
RR

Why Microsoft Access Refuses to Calculate a Form Footer Total That Should Work - QQ #82

Ever try to total up a simple sum in your Access form footer and wind up with one of those classic pound errors instead? You'd think adding up numbers would be the easiest thing in the world, but Access has its own sense of humor. Let's dive into some of the sneaky traps you might fall into with totals, combining lists from different tables into one sexy combo box, why something that works for you may blow up on a client's PC, and some quick fixes for those "just make it do this automatically" requests. Oh, and a couple other classic beginner headaches that everyone hits at some point.

The real fun starts right away once you're actually trying to build useful forms - like, for example, picking people (customers, vendors, employees, your cousin Joey) from a drop-down list. But what happens if all your people are stashed in different tables? Maybe you want to choose a contact for a task and your contacts are split all over the place. Does Access magically know how to put them together? Of course not. But you can pull that trick off, and here's how.

The go-to solution for combining folks from multiple tables into a single list is a union query. Suppose you've got a table for customers and another for employees. As long as the basic columns line up - say, FirstName, LastName, ID - you can use a union query to glue them together for use in one combo box, one list box, or anywhere else you need to put them side-by-side. Keep your union queries simple! If you try to get too fancy piling on different data types or complicated calculated fields, things can go sideways pretty fast. For big Frankenstein operations, it's usually better to load the pieces into a staging (temporary) table first.

But here's a little design tip: if you find yourself always juggling different "types" of people, why not just start off with one big People table? Give everyone a PersonType ID so you know if they're a customer, vendor, employee, salesperson, or whatever. Then filtering is as easy as setting a criteria on PersonType. Even slicker: with a junction table, a person could be in multiple categories. Makes life and filtering easier all around! Of course, redesigning can be a big step, so if you want a fast fix, stick to the union query for now.

Now, here's a common developer gotcha: your code works just fine at home but bombs spectacularly at a customer's office. First rule - don't panic! It's probably not even your code. Office/Windows environments can break things in all kinds of creative ways. Sometimes it's just that the user isn't logged into their Office account (yes, that's a thing). If Access or Office isn't fully activated or registered, some features won't work, even if they did for you. Other culprits? Missing references, trusted locations, antivirus, or mismatched versions. Before tearing apart your beautiful logic, have them check their setup: log into Office, run a Compact and Repair, restart, and check out my troubleshooting guide (linked in the video above) for the full checklist.

Speaking of those annoying errors, let's talk about getting sums to work in a form footer. Here's the situation: you've got a continuous form with, say, credit limits for customers, and you want an easy total at the bottom. Sounds simple… until you try to sum a calculated control in the footer - like maybe you put "CreditLimit * 2" in an unbound text box and want to total that up. Suddenly, Access starts throwing its favorite pound error at you. What gives?

This is one of those things that makes you want to shake your monitor. Here's why: the Sum() function only works on fields that are part of your form's record source. If that control is unbound and calculated right on the form, Access can't add it up in the footer. The fix? Move your calculation to the underlying query. Don't do fancy math right in your form controls - just add a calculated field in your query (e.g., CreditLimit2: [CreditLimit]*2), and base your form on that. Now that field is part of your record source, and the Sum() in your form footer will work just fine. Trust me, this one catches everybody, so don't feel bad.

Another common hangup is with paths containing spaces, especially when using DoCmd.OutputTo or FollowHyperlink and trying to pull the path from a form control. If your code works with a hard-coded path but crashes when you use, say, Me.FilePath, it's usually about how you wrap your string in quotes. Access loves to make a mess with those double double quotes. If you need details on exactly how to format those, check out the links in the video above - just know it's all about getting the right string concatenation and escaping those pesky spaces properly.

Ever want a process to "automatically" update a date cycle, like always having the latest three-year window for your records? Here's the golden rule: nothing in Access happens automatically unless something triggers it. You can use an update query launched by a button, a macro, or even a little VBA fired off when your database opens. There's no Access fairy running nightly updates, so plan on attaching your update logic to an event - like a form opening, a timer, or maybe a scheduled Windows Task running Access in the middle of the night. Whatever you choose, you have to kick things off.

Let's answer a classic beginner question: What's the difference between a table and a query? Think of a table like your pantry - it's where you actually keep the food (data). A query is more like a recipe or shopping list; it tells Access what to pull and how to arrange it, but it doesn't store anything itself. Use tables to store your records, and queries to view, sort, filter, and summarize them. That's your crash course in Access database philosophy.

One more quick tip: if you're working in the VBA editor and want to quickly switch back to your Access window, there's a "View Microsoft Access" button that brings Access back to the front. Yes, Alt-Tab works too, but sometimes those little built-in buttons you never use are worth a look! Thanks for the reminder, Gary.

Whether it's form design, code that blows up on someone else's PC, path formatting headaches, or those mysterious sum errors, just remember Access is a lot more predictable when you know where its quirks live. And if you ever get stumped, the best thing is to ask - everyone started out as a beginner before they were an "expert." If you want a deeper dive or to see some of these examples in action, make sure you check out the video embedded right above. There's always more where that came from!

Live long and prosper,
RR

Thursday, March 5, 2026

How to Create File Folders in Microsoft Access VBA Using the MkDir Statement

Ever open a folder only to find it jam-packed with tens of thousands of invoice PDFs, all jumbled together in one big digital haystack? If that sounds familiar, it's time to let Microsoft Access do the heavy lifting and organize those files for you automatically. No more scrolling endlessly or trying your luck with search - there's a better way!

Let's talk about how to get Microsoft Access to create customer-specific folders for your invoices (or any files, really) instead of dumping everything into a single directory. This is especially helpful if, like Colin from Charleston, you've been exporting invoices for years and now face an overwhelming mess. With just a bit of clever VBA - and the handy MkDir command - Access can automatically keep your folders neat, organized, and easy to navigate.

The first thing you'll need to know is that creating folders from Access uses a simple command called MkDir - which, as the name suggests, stands for "Make Directory." This bit of VBA code allows Access to create new folders on your drive, right when you need them. If you're new to VBA, don't worry; start with any beginner tutorial on Access VBA, and you'll be ready in no time. Plus, keep some basic error handling in your toolbox, so you don't get caught off guard by common issues, like trying to create a folder that already exists.

Picture your workflow: every time an invoice is created from your database, you want Access to save it as a PDF in a folder structure like Invoices > CustomerID. This way, each customer has their own subfolder, and you - and your team - can find files quickly without digging through a mountain of PDFs.

Here's how it works. Before exporting your PDF, instruct Access to check if the "Invoices" folder exists inside your chosen parent directory (say, your database folder or a network share). If not, Access will create it using the MkDir command. Next, Access will create or check for a subfolder within "Invoices" that corresponds to the current customer's ID. Each time you generate a new invoice, Access will ensure this folder structure exists, and then save the PDF right inside the proper customer folder.

Now, here's something important: MkDir isn't picky, but it'll throw an error if you try to create a folder that's already there. That's totally expected, so you can keep your code smooth by telling Access to "resume next" on errors just for those folder-creating lines. If you want to get fancy (or just a bit more robust), check out additional error-handling techniques - or the Dir function - to see if a folder exists first, but for 99.9 percent of cases, a simple setup like this is all you need.

Once the folders are created, your export command points right to the customer's new home in the file system. No more invoice chaos! I always recommend storing file paths in variables if things get complicated; that way, you're not repeating yourself or accidentally missing a backslash somewhere. Also, never forget to refresh your form or commit your data before exporting. You want your invoices to reflect the latest info, not yesterday's news.

This system is scalable. Whether you have a dozen invoices or tens of thousands, Access can handle organizing them - just by tweaking how and where invoices are saved. Want to see more advanced tricks, like checking for missing parent folders, moving existing files into the new structure, or making folders with customer names? That's all possible - just expand your VBA toolkit step by step.

And as always, don't be afraid to experiment. This method works not just for invoices, but for any kind of file you want to manage more efficiently from Access. You're basically turning Access into your own mini document management system. Pretty cool, huh?

If you want to learn about more advanced techniques - like recursive folder creation or file management within Access - check out developer resources and my training videos for those deeper dives. Also, if you're worried about the moral implications of "Tribble Jerky" (yeah, I went there), feel free to share your thoughts in the comments...

So, today you saw how Microsoft Access and a little VBA (MkDir command) can team up to organize your files, keeping your directories tidy and easily searchable. No more endless scrolling or PDF pile-ups!

If you're curious about the step-by-step visuals or want to see exactly how the VBA comes together, check out the video above for a full walkthrough. Feel free to leave a comment below and let us know how you'll put this trick to work in your own database.

Live long and prosper,
RR

Wednesday, March 4, 2026

How To Test If A File Exists In Microsoft Access VBA Using The Dir Function

Ever had your Access database blow up in a flurry of error messages just because it tried to open a file that wasn't there? Yeah, nothing like making your users think their computer's haunted. Today, let's put an end to those surprise meltdowns and learn how to gracefully check if a file exists before trying to open it in Access with VBA. Your users will thank you - and so will your blood pressure.

Picture this: You've got a field in your Customer table that stores the full path of their resume file. Maybe you even have a neat button that, when clicked, opens up that file. But - plot twist - the file sometimes isn't where it's supposed to be. Instead of Access calmly telling you "Hey, file not found," you get blasted with a confusing error no sane person can decipher. There's a way to sanity-check the file's existence before trying to open it, so let's jump right into how that's done in VBA using the handy DIR function.

The magic sauce here is the DIR function. If you're not familiar, think of DIR as the VBA equivalent of the old-school Windows command prompt DIR command. It checks the file system and tells you what's there. In VBA, you feed DIR the path and filename you want to check. If the file exists, DIR returns the filename. If not, you get an empty string. No hype, no drama, just the facts.

Imagine your customer table has a "Resume File" field. Now, we've talked before about why you shouldn't store actual files inside your database (seriously, don't do it), but storing links to files is totally fine. You store the full path and filename as text, like "C:\MyDocuments\ResumeFile.txt". When a user wants to open the file - be it with a button or a double-click event - your code needs to check if that file is actually sitting there before launching your favorite text editor or viewer.

Let's say you use a button called "Open Resume." Traditionally, you might launch the file right away using the Shell function or FollowHyperlink, assuming all is good. But if the file's missing, the user gets an error - sometimes from Access, sometimes from the program you're launching (like Notepad saying "Can't find this file, want to create a new one?"). Not very slick.

Here's what you do: before opening the file, insert the DIR check. If DIR returns an empty string, you know the file's missing. Show a friendly message box to the user and exit the subroutine. If it returns the filename, let the process flow as usual. This is a great way to give your users a nice, user-friendly heads-up instead of leaving them wondering what went wrong.

Don't forget to compile your code often. Trust me - debugging five missed semicolons because you forgot to compile isn't how anyone wants to spend their Friday afternoon. Also, remember that when you paste file paths from Windows Explorer using "Copy as Path," Windows often adds double quotes to the filename. You absolutely must remove them before pasting into your database. Little things like this can trip you up if you're not careful.

Now, you might be thinking, "Why not just use error handling instead of checking first?" Good question! The problem is, with something like Shell launching Notepad, the error doesn't happen inside Access - it happens in Notepad. That means your error handler never gets a shot. Using DIR in advance keeps the process neat and controlled.

If you're curious about more advanced tricks - like looping through every file in a folder with DIR, or why you should never store attachments in your Access tables - there are deeper dives you can explore later. But for the everyday Access user, learning to use DIR as a quick safety check will save you and your users a lot of hassle.

So, next time you set up a file link in Access, take that extra minute to check it with DIR before you open it. It's a simple way to make your databases more user-friendly and less likely to make someone panic when a file is missing.

For those wanting to see the actual VBA code for this (and all the nitty-gritty details of what goes where and why), check out the video embedded above!

Live long and prosper,
RR