Text Box Margins
By Richard Rost
2 years ago
Align Text Boxes with Margins: Dates & Currency
In this Microsoft Access tutorial, I will show you how to align text boxes that contain dates and currency values so that they appear neatly aligned in your forms. By adding the right margins, we can ensure your columns look professional and tidy.
Brandon from Tustin, California (a Platinum Member) asks: In Microsoft Access, I have a column of vertical text boxes on a form. Some of these boxes are formatted as currency and some as dates. The currency values leave extra space to the right for the potential parenthesis of negative numbers, but the date values do not, causing the column to look misaligned. How can I add some space to the right of the text boxes containing date values to make the column appear neatly aligned?
Members
There is no extended cut, but here is the database download:
Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the files from class plus get access to the Code Vault. If you're not a member, Join Today!
Prerequisites
Keywords
TechHelp Access, Align Text Boxes, Microsoft Access Forms, Adjust Text Box Margins, Currency Text Boxes, Date Text Boxes, Text Box Alignment, Access Form Design, Right Margin Adjustment, Text Box Padding, Form Layout Tips, Adjusting Margins in Access, Microsoft Access Tutorial, Form Formatting, Add Space to Text Box
Intro In this video, I will show you how to align numbers, dates, and currency values neatly inside text boxes in Microsoft Access forms. We'll address the common issue of extra space making your columns look misaligned, and I'll walk you through setting margins inside your text boxes to get everything looking consistent. You'll learn how to use the property sheet and Format tab to adjust right margins, understand the difference between margin and padding, and fine-tune your layout for a polished appearance.Transcript Today we've got one for the beginners. I'm going to show you how to line your text boxes up so the numbers, dates, and currency all look aligned inside the text boxes.
All right, it's easy to line the text box itself up, but if you look inside there, you get a little extra space. See that? We're going to make it look all nice and pretty, just like that one. Okay.
All right. Today's question comes from Brandon in Tustin, California, one of my platinum members. Brandon says, "I've got a column of vertical text boxes on a form. Some of these boxes are formatted as currency and some as dates. The currency values leave extra space to the right for potential parentheses of negative numbers. But the date values do not, causing the column to look misaligned. How can I add some space to the right of the text boxes containing date values? Make the column appear neatly aligned."
Well, Brandon, we can do that very easily by setting a margin inside those date values, number values, or whatever other ones aren't lining up. Because you guessed it correctly, if you use the currency data type, right, you're going to have parentheses around this guy. So, it leaves a little extra space here for that parenthesis if it's negative, which these guys don't have that problem. So, we're just going to add a little padding in here, well, not padding. We're going to add margin in here; padding is a different thing. Okay, and let's see how we can do that.
Here I am in my TechHelp free template. This is a free database you can get off my website if you want to. And in here, I've got a customer form, and right here, I've got three number fields aligned. Now me personally, I'm a left-align guy. I don't really like lining stuff up to the right, but I know most people like to line stuff up to the right. So, let's move this out of the way for a second here, and let's take these guys and let's left-align those values. So, I'll come up here to Format.
And if you don't know what I just did, I normally keep my ribbon collapsed, especially when I'm recording videos, because I don't want to see all that stuff. But if you double-click, it opens it up like that. So, you can keep this open now. Okay, all right, so select these and they'll hit right-align. And then what I'll do at this point is I'm going to save it and close it and open it back up so I can make sure it's looking good. Okay, good. Now you can see the problem I got there. All right, these guys are right up against the edge of the text box. This guy, if it were negative, it would look like that. Same, it would have had little parentheses. There's still a little bit of extra space in there. All right, but I'm going to get rid of that and we'll leave it just like this. All right, so what we're going to do is we're going to add some margin to these two text boxes. So right-click, design view. I'm going to open this up a little bit so you can see more.
I'm going to select both of these guys just by drawing a box that touches them, just like that. You don't have to go all the way around. A lot of people think you got to go all the way around them. And I just accidentally grabbed more than I meant. Just draw a box that just touches them, just like that. Okay, now on the Format tab, if you don't have the property sheet up, by the way, right-click on either one of these guys and pick properties. In fact, I'll show you. It's way at the bottom, right-click, and you're going to go all the way down here to properties. And then that will bring up that property window or close it. I had it open, so I'll click on it again. It just toggles it on and off. All right, so with these two selected, I'm going to come over here, go to Format. And we're going to find margins. We're either right here, top, bottom, left, right, margins, which is different from padding. Don't worry about padding. I'll cover padding in a different video. What we want to do is give these guys a right margin, something very small, maybe 0.1. Let's see what that looks like.
All right, save it. I'm going to close this and open it back up again. Okay, that doesn't look too bad. It's a little bit too much. Maybe let's scale it down a little bit, back to the design view. All right, and oops. And again, let's open this up. Select these two. Find that right margin right there. If you click on it over here, by the way, it selects the value over there, instead of you having to click in here and do that. Let's go 0.09. All right, now when you do that, it changes to 0.0903. There's a thing called Twips, and it's got to be exact. A lot of reasons why I just get as close as you can without me going into a scientific explanation. As far as why those numbers change. In fact, let's do 0.08. 0.08, there we go. And then that changes to 0.0799. All right, let's see what that looks like. Close it, open it. That's almost, almost right. Maybe just a touch less. Just a little teeny tiny bit less. Let's come in here and select them again. Let's go 0.07. All right, 0.0701, let's do that one. And there we go. That's almost perfect. There you go. So, these guys have a little bit of a margin next to them, and this one does not. And you can do the same thing with left margins, right margins, top margins, all that stuff.
OK. If you like learning about this stuff, I cover all kinds of different form formatting techniques in my beginner series. You can start with Microsoft Access Beginner Level 1. It's absolutely free. It's four hours long. I teach you all the basics, everything you need to know to get started. And I got lots more beginner, expert, advanced, and developer lessons. So, if you want to learn Access, I'm your guy. I got lots of lessons for you on my website. Check them out, people, you'll find links down below.
But that is going to be your TechHelp video for today. I hope you learned something. Live long and prosper, my friends. I'll see you next time.
A special thank you and shout out to our diamond sponsors. First, we have Juan Soto with Access Experts Software Solutions, Manufacturing Experts, specializing in Access and SQL Server. Juan is a 13-time Microsoft Access MVP. You can check them out at accessexperts.com. Another shout-out to Sammy Shama from Shama Consultancy. Sammy is a certified Microsoft Office specialist, and he not only offers access application development, but he also provides one-on-one tutoring services. So, if you need someone to hold your hand and help you with your Access project, Sammy is your guy. Check them out at shamaconsultancy.com.
TOPICS: Lining up text boxes for consistent appearance Addressing extra space issues in text boxes Formatting text boxes as currency or dates Setting margins inside text boxes Adjusting right margin for text box alignment Navigating the property sheet in design view Using the Format tab to set margins Difference between padding and margin Fine-tuning margins using Twips measurement Testing and adjusting margins for perfect alignment
COMMERCIAL: In today's video, I'll teach you how to align numbers, dates, and currency in your text boxes so they look perfect. We start with Brandon's question from Tustin, California about misaligned columns due to extra space in currency fields but not in date fields. I'll demonstrate how to add margins specifically to fix this. We'll go into Access, align our fields, tweak the right margin, and test it until the columns look just right. You'll find the complete video on my YouTube channel and on my website at the link shown. Live long and prosper my friends.Quiz Q1. Why do currency values often leave extra space to the right within text boxes? A. Because currency values are longer than dates. B. Because currency formatting includes space for parentheses around negative numbers. C. Because there is a default padding applied to currency values. D. Because currency values are always right-aligned by default.
Q2. What solution is presented for aligning text boxes with mixed content such as currency and dates? A. Changing the background color of the text boxes. B. Increasing the font size of the date values. C. Adding a right margin to the text boxes containing date values. D. Using a different font style for date values.
Q3. Which formatting option in the properties sheet is used to adjust the space inside a text box? A. Padding B. Font Size C. Margins D. Border Style
Q4. In the video, what margin value was found to align the text boxes nearly perfectly? A. 0.1 B. 0.09 C. 0.08 D. 0.07
Q5. How do you access the property sheet for a text box in design view? A. Go to the File menu. B. Right-click on the text box and select Properties. C. Double-click on the text box. D. Use the View tab on the ribbon.
Q6. What difference is mentioned between margins and padding in the context of text boxes? A. Margins adjust the internal spacing; padding adjusts the external spacing. B. Margins adjust external spacing; padding adjusts internal spacing. C. Margins affect only horizontal spacing; padding affects only vertical spacing. D. Margins and padding are synonymous in the context of text boxes.
Q7. Why is it sometimes necessary to open and close the form after making design changes? A. To ensure the changes are saved. B. To reset the form to its default state. C. To see how the changes affect the layout. D. To update the data source.
Q8. Which of the following can be aligned using margins in text boxes? A. Only text values B. Only number values C. Only currency values D. Any type of value
Q9. How do you select multiple text boxes in design view? A. Hold down Shift and click each text box. B. Draw a box that touches the text boxes. C. Double-click each text box while holding Alt. D. Click each text box with the right mouse button.
Q10. Where can you find more lessons and tutorials about Microsoft Access? A. On the Microsoft official website. B. In the beginner series on the tutorial maker's website. C. Through an email subscription service. D. On the local library website.
Answers: 1-B; 2-C; 3-C; 4-D; 5-B; 6-B; 7-C; 8-D; 9-B; 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 TechHelp tutorial from Access Learning Zone focuses on a fundamental concept for beginners: aligning text boxes for numbers, dates, and currency so they appear neat and tidy. It's straightforward to align the text boxes themselves, but there's often extra space inside that can disrupt the alignment. The goal is to ensure everything looks well-organized.
Brandon from Tustin, California, one of my platinum members, reached out with a query about this. He has a form with a column of vertical text boxes, some formatted as currency and others as dates. The issue is that currency values leave additional space to the right, allowing for negative number parentheses, whereas date values do not. This misalignment makes the column appear disorganized. Brandon wants to know how to add space to the right of date values to achieve a neatly aligned column.
This can be easily addressed by setting a margin inside the text boxes for date or number values that require alignment adjustment. For currency data types, the space is already provided for negative parentheses. By adding a margin, rather than padding (which is different), we can resolve this discrepancy.
In my TechHelp free template, available on my website, I have a customer form with three aligned number fields. Personally, I prefer left alignment, but I understand the preference for right alignment. Let's take a moment to adjust these values for left alignment by accessing the format options.
If you're unfamiliar with the process, I usually keep my ribbon collapsed when recording videos for a cleaner view. You can double-click to expand it and maintain it open. Let's select the text boxes and apply right alignment. I'll save, close, and reopen to verify they look correct.
Now, observe the text boxes closely. The currency fields have additional space for potential negative parentheses, while others do not. To add a margin, enter design view. Select the text boxes by drawing a box that touches them, without encircling them completely. Access the property sheet, located at the bottom of the right-click options, and open it if necessary.
With the text boxes selected, navigate to the Format tab and locate margins (distinct from padding). We'll start by adding a small right margin, around 0.1, to see how it looks. Save, close, and reopen the form to check the result. If it's excessive, return to design view and adjust the margin to slightly smaller values, such as 0.09 or 0.08. Consider 'Twips' - a measurement unit - that may cause numbers to appear slightly altered. Adjust accordingly until the alignment is visually satisfactory.
These margin adjustments apply equally to left, right, and top margins. If this interests you, I cover various form formatting techniques in my beginner series. You can start with Microsoft Access Beginner Level 1, a four-hour free course introducing the basics. Beyond that, I offer beginner, expert, advanced, and developer lessons on my website.
That's today's TechHelp tutorial. I hope you found it instructive. Live long and prosper, my friends. You can find a complete video tutorial with step-by-step instructions on everything discussed here on my website.Topic List Lining up text boxes for consistent appearance Addressing extra space issues in text boxes Formatting text boxes as currency or dates Setting margins inside text boxes Adjusting right margin for text box alignment Navigating the property sheet in design view Using the Format tab to set margins Difference between padding and margin Fine-tuning margins using Twips measurement Testing and adjusting margins for perfect alignment
|