Premium Only Content

Conditional Display of Company or Person Name in Microsoft Access
Today's TechHelp tutorial from Access Learning Zone covers how to display either a person's name, a company name, or both conditionally in your Microsoft Access database.
Marcellino from Hefsabud, Georgia, one of our silver members, has asked a great question. In his table, he stores fields for company name, first name, and last name. Sometimes, he has all three, but other times he only has a company name or a person's name. He wants to ensure that when printing statements, the company name shows up if it's available, and if not, the person's name is printed instead.
There are a couple of ways to achieve this. First, I'll show you a basic method that involves adjusting some property settings on your reports. Then, I'll share a more advanced solution that doesn't require programming but will involve a few functions. The advanced method yields better results, but the beginner method is sufficient if you're looking for something quick and simple.
Before we dive in, make sure you've completed my Access Beginner Level One course. It's free and available on my website and YouTube channel. Also, familiarize yourself with the Can Grow and Shrink functionality, which allows fields without data to disappear on your reports.
Let's start with the beginner method. I'll use my TechHelp free template, which you can download from my website. This template includes a customer form with personal information, such as first name, last name, and address. I'll add a company name field to the customer table.
First, open the table in design view and add the company name field below the first and last name fields. Switch to datasheet view and enter some sample data. You should have a mix of records: some with both company and personal names, some with only company names, and some with only personal names.
Next, open a blank report template where I've set up basic settings like margins. Duplicate this template and name it something intuitive like "Customer Report." In the design view of this report, set the record source to the customer table. This ensures the report pulls data from the correct table.
Add the necessary fields from the customer table to the report: first name, last name, company name, and address. For aesthetic purposes, remove the default labels, arrange the fields in an address block format, and resize them as needed.
Save the report and preview it. Initially, you'll notice that some records will display blank fields, depending on the data. To make these fields disappear when they are empty, enable the Can Shrink property for the text boxes and the detail section of the report. This makes sure that if there's no data in a field, it won't display extraneous blank space.
After adjusting the properties, save and preview the report again. Empty fields should now be hidden, making the report look cleaner.
While this method is straightforward, you might be looking to add more professional touches, such as a conditional statement like "Statement prepared for" followed by either the company name or the person's name. For that, we can use a query and some functions, which I'll cover in a future video.
This concludes today's tutorial. If you want step-by-step instructions and a complete walkthrough, visit my website for a full video tutorial.
Live long and prosper, my friends.
For a complete video tutorial on this topic, please visit https://599cd.com/CompanyorPerson?key=Rumble
-
2:24:17
Barry Cunningham
8 hours agoFOR PRESIDENT TRUMP WILL TAKE NO PRISONERS AND THE LIBS SHOULD EXPECT NO MERCY!
117K74 -
1:08:41
Savanah Hernandez
9 hours agoCharlie Kirk Was Our Bridge And The Left Burned It
64.8K59 -
1:59:01
Flyover Conservatives
11 hours agoFinancial Web Behind Charlie Kirk's Murder with Mel K | Silver On It's Way to $50 | FOC Show
73K12 -
2:36:19
We Like Shooting
20 hours ago $1.73 earnedWe Like Shooting 628 (Gun Podcast)
47.4K1 -
1:09:26
Glenn Greenwald
11 hours agoTrump's Shifting Immigration and H-1B Policies: With Journalist Lee Fang and Political Science Professor Ron Hira | SYSTEM UPDATE #515
180K41 -
13:09:23
LFA TV
1 day agoLFA TV ALL DAY STREAM - MONDAY 9/15/25
264K66 -
54:12
Donald Trump Jr.
10 hours agoCharlie's Vision. Our Future. | TRIGGERED Ep274
210K132 -
1:03:35
BonginoReport
11 hours agoKirk’s Alleged Killer Dating Hateful Transgender??? - Nightly Scroll w/ Hayley Caronia (Ep.134)
135K156 -
1:01:12
The Nick DiPaolo Show Channel
13 hours agoKirk Assassination Exposes Insane Left | The Nick Di Paolo Show #1793
107K34 -
1:48:38
The Mike Schwartz Show
11 hours agoTHE MIKE SCHWARTZ SHOW Evening Edition 09-15-2025
60.1K13