DEV Community

Cover image for Copy Bill To to Ship To in Microsoft Access
Richard Rost
Richard Rost

Posted on

Copy Bill To to Ship To in Microsoft Access

Today's TechHelp tutorial from Access Learning Zone will address a common question I receive frequently, despite having covered it in past lessons. People often ask how to copy the billing address to the shipping address in Microsoft Access. We'll be creating a button to facilitate this action. It's relatively simple, and I'll demonstrate two approaches. The first is what I call the "expert" method, avoiding programming by using a macro. Many people want such functionalities without delving into programming, often feeling intimidated by VBA, though they shouldn't be. I'll also show the developer method, which may actually be simpler for some.

This inquiry comes from Milton in Paramount, California, a platinum member. This question has lingered in the TechHelp queue, with numerous people asking about it. Considering today is October 8th, 2024, as I prepare for Hurricane Milton's arrival in Southwest Florida tomorrow, it seemed fitting to tackle Milton's question.

Milton asked how to efficiently copy the billing address into the shipping address fields on an order form in Microsoft Access. He finds entering the same address twice to be time-consuming and is looking for a way to automate the process through a trick or button. That's exactly what we'll explore today. As a prerequisite, you should have watched my blank template video, which covers building the TechHelp free template. We'll use the customer form from this database. If you haven't seen it, I recommend watching it first.

In the free template, downloadable from my website, the customer form includes fields for address, city, state, zip code, and country, representing billing information. To add shipping details, we need to duplicate these fields in the table. In the customer table's design view, I'll copy the address through country fields and paste them at the bottom. To distinguish them, I'll prefix each with "ship to."

Renaming the original fields to "bill to" isn't necessary. If you make changes, Access will typically update the fields in your queries, forms, and reports, but not in any VB code you've written. It's often best to leave them unchanged if they're already widely referenced.

After saving and closing, we'll update the customer form to include these new fields. In the design view, I'll adjust the layout slightly, copying and pasting the address fields to sit beneath their billing counterparts. I'll modify each to correspond to the shipping fields, matching the textbox names with the control sources, which is the recommended practice.

Some might prefer using the field list to drag fields onto the form, but my method seems more straightforward to me. Access offers numerous ways to accomplish tasks, which is one of its appealing aspects. Many people suggest alternative methods in the comments, but there's no single correct approach.

To differentiate the billing and shipping information for users, color-coding and labeling are helpful. I'll add labels for "bill to" and "ship to" and color-code the sections accordingly. By copying and pasting a label, then adjusting the background colors, I create a visually clear distinction between the two sections. Positioning involves slightly shifting labels and textboxes for better alignment without individual repositioning. A box around the sections, colored appropriately, enhances clarity.

Finally, I'll format the labels and textboxes by adjusting the text and background colors, bolding where needed, to ensure everything is visually cohesive and accessible. Once satisfied, save and close the changes. Upon reopening, the form should look organized and intuitive.

We'll place a button allowing users to copy billing information into the shipping fields conveniently. Now that the setup is complete, we can proceed with building the macro to perform this function, which we'll cover in the next video.

That's today's TechHelp tutorial. I hope you found it informative. For a complete video tutorial with step-by-step guidance on everything discussed here, visit my website at the link below. Live long and prosper, my friends.

For more please visit https://599cd.com/BillToShipTo?key=Dev.To

Top comments (0)