Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Creating a customer form

From: Access 2010: Forms and Reports in Depth

Video: Creating a customer form

So far we've taken a look at creating navigation forms to move around our database, we've created a reference form in our employee directory and we've created a form that looks up orders that include a particular product. Let's now create a form that can be used to import records into our data tables. We'll create a form that can be used to capture information about new customers. I'm going to close our Main Menu window here and I'm going to click once on my DirectCustomers table and go to the Create tab and by clicking on Form we'll build a quick form that I can then edit. So, there's my form here, it's showing me data at the top and if I scroll down I can see that Access automatically put in a subform.

Creating a customer form

So far we've taken a look at creating navigation forms to move around our database, we've created a reference form in our employee directory and we've created a form that looks up orders that include a particular product. Let's now create a form that can be used to import records into our data tables. We'll create a form that can be used to capture information about new customers. I'm going to close our Main Menu window here and I'm going to click once on my DirectCustomers table and go to the Create tab and by clicking on Form we'll build a quick form that I can then edit. So, there's my form here, it's showing me data at the top and if I scroll down I can see that Access automatically put in a subform.

Let's go into Design View. I'll change my View to Design View and we'll clean this up. First, I'm going to scroll down and I'm going to get rid of that subreport. I'll click on it and press Delete. I'm going to scroll back up. Next, I want to get rid of these headers. So, I'll click on the Detail section and then right-click and turn off Form Header/Footer here. Since, there's content here, I've got an icon and this label. Access is going to confirm that I want to delete those. So Yes, get rid of that. Next, I want to realign some of these objects. They're pretty big for the data that's inside. Now, by default Access groups everything together so it's easier to edit in Layout View.

I think it's even still easier to edit things in Design View. In order to do that though, I need to ungroup these objects. So, I'm going to press Ctrl+A to select everything. I'll go the Arrange tab and I'll say Remove Layout. Now, these elements are all individual. I can deselect them by clicking off in the space above. I'm going to resize this Customer box here, make it a little shorter. Now, I'll select everything again, and I can go, Size/Space>To Shortest, to make them all the same height. Then I can go to Size/Space and say Decrease Vertical to make them all evenly spaced and decrease the size a little.

Now, I'll do that a couple of times to bring them all together. Size/Space>Decrease Vertical. We'll do it a few more times to nudge them all together. Next, I'm going to resize my form. So, I'm going to deselect all of these objects and then I'm just going to select the ones on the right. I'll scroll over, I'll grab the right edge and I'll bring it in to maybe about 3 inches. Then I'll grab the right edge of my form and drag it into about 3.5. I'll scroll over. It's looking good. I need to bring the bottom up now. So, I'll scroll down. So, I'll scroll down and drag the bottom up, maybe about 4 inches.

That leaves me enough room at the bottom to add some command buttons. Now, let's take a look at some of the properties for our form. I'll select out form selector here between the rulers. I'll go to the Other tab here and I'm going to make this a pop-up window. So, instead of No, I'm going to choose Yes. I also want to make sure that the user interacts with this form or closes it before they can do anything else in the database. So, I'm going to choose Modal to Yes as well. In the Format tab I can find the Caption property. The caption is what's going to appear at the top of the window. Here, I'm going to say Add a new customer. I'll press Enter and then finally in the Data section in the Data Entry property here, it's currently set to No, I'm going to change that to Yes.

What that will do, is it'll force this form to only enter in records into the customers table. It's not going to allow me to view records that are in the customers table, it's just for data entry. Let's go ahead and press Enter to finalize and we'll view our form here. I'll switch to Home and view into Form View. So, there's my form. I might want to get rid of these record selectors and this bar over here on the right as well. So, let's go ahead and go back into Design View. I'll right click, Design View. I can find those into the Format tab. We'll scroll down till we get to Record Selectors, change that No and Navigation Buttons, No as well.

Now, we need to add a couple of buttons, so the user can interact with our form. We'll go to the Button wizard by clicking the Button control and pressing the button there. Now, let's take a moment here and think about the workflow here. When you enter in records into Access, Access is automatically saving those records straight into the data table. So, if the end-user comes to this form and they type in some values and then they close the form, what's actually happening is that Access is taking the data and saving it to the table before the form is closing. So in essence, closing the form is the same as saving the data and closing the form.

If I want to have the ability to cancel out, so for instance, you might have typed something in and then decide you don't want to do that, before I can cancel, what I need to do is make sure that these fields are cleared out, that they're empty; they don't contain any data before closing the form. If they contain anything at all, that's going to get saved into the data table. Now, I want to make sure that I have an easy workflow for my end-users and they don't really have to worry about that. So, I'm going to create two buttons here. One is going to be Save Customer and the other one's going to be Cancel Entry, but I need to think about these macros a little bit in order to make the functionality work as intended.

So, this first one is going to be the Save Customer one and I can go to Form Operations and Close Form, and the act of closing the form will automatically save those records into the table. Let's go ahead and say Next. The Text button, instead of Close Form, we're going to say Save Customer, and we'll say Finish. So, there's my first button. The second one is going to be a little bit more complicated. We'll add this button control; we'll add that down below. This one we need to clear out the records first. So, we're going to go to Record Operations and then Delete Record, that will clear out everything within this form.

Let's go ahead and say Next. The Text for this button is going to be CancelEntry, we will press Next and Finish. Now, when I click this button CancelEntry, it's just going to clear out the form. I'm going to actually edit this macro, so that it clears out the form and then closes it as well. So, again, for the button, we'll go to the Event tab, the On Click event is this Embedded Macro that we just built with the wizard. I'll click build to edit it, and you can see all of the error controls that Access added into this macro. All I need to do is scroll to the bottom, we'll add a new action and we'll say CloseWindow.

We can leave the Object Type and Object Name blank. It'll close the active window, which is going to be that Add Customer form. I'll close my macro and save that change. Let's go ahead and format our buttons, I'll Shift+Click to select both of them. Go to Format, we'll choose our green style, so we're consistent throughout the database. We'll go to the Arrange tab; we'll Size/Space them To Widest, and then we'll Align them to the Right. Now, they're aligned inside the same, I can use my arrow keys to nudge them into position, and I'll just put them over here on the right. So, they align up with the edge of my text boxes. All right! Let's go to the Home tab and view our form here.

So, there's my Add a New Customer form, it's a pop-up form. I can type in some values here. I can Save the Customer or I can Cancel Entry. Right now I'm going to go ahead and cancel this entry. It's going to ask me if I want to save this and I'll go ahead and say Yes, I'll save that form and it'll ask me for a name. I'm going to create this as Add a new customer, that's fine. Go ahead and say OK. Now the final step of our workflow is to add this into our Main Menu structure. I'll double click to open up our Main Menu and then I'll right click on it to go into Design View. We'll add a button here that says Form Operations, Open the Form, Next.

We want to open the Add a new customer form, Next and Finish. Now, we've got a button that'll edit that. It's got an icon on it, I can change that. If I go to the Format tab where it says no Picture Caption, I can change that to Right. We'll add text to the right side. The caption here will be Add a customer. I'll make my button a little wider, we'll format its color, and we'll move it into position. Let's go ahead and close our menu. We'll save our changes and we'll look at our workflow now.

I'll scroll down, double click on Splash Screen. We'll see the Splash Screen works. It opens up the Main Menu. Now, I can click Add a new customer. I get my new customer window, I can type in the values and Save, or I can cancel the process. So, data entry tasks don't really have to be a chore, with a little thought into the layout of a data entry form, your end-users will be able to quickly and accurately capture the information that you need to store in the database.

Show transcript

This video is part of

Image for Access 2010: Forms and Reports in Depth
Access 2010: Forms and Reports in Depth

38 video lessons · 14659 viewers

Adam Wilbert
Author

 
Expand all | Collapse all
  1. 1m 27s
    1. Welcome
      1m 2s
    2. Using the exercise files
      25s
  2. 15m 53s
    1. Introducing forms
      2m 41s
    2. Designing for the end user
      45s
    3. Exploring the database
      1m 49s
    4. Creating a form with the Form Wizard
      6m 43s
    5. Refining the form in Layout view
      3m 55s
  3. 24m 33s
    1. Organizing the form elements
      7m 14s
    2. Formatting
      4m 48s
    3. Modifying the form through its properties
      6m 56s
    4. Adding a header and some polish
      5m 35s
  4. 1h 2m
    1. Introducing form controls
      3m 48s
    2. Using lines and rectangles
      2m 48s
    3. Organizing screen space with tabs
      4m 47s
    4. Adding buttons
      5m 3s
    5. Linking to external content
      4m 15s
    6. Entering and selecting data
      5m 8s
    7. Controlling input with option groups
      6m 0s
    8. Attaching documents
      6m 49s
    9. Attaching images
      5m 8s
    10. Understanding the subform control
      4m 13s
    11. Adding charts
      7m 9s
    12. Linking controls
      7m 41s
  5. 21m 42s
    1. Creating the main menu
      8m 49s
    2. Adding a splash screen with startup options
      5m 35s
    3. Creating a customer form
      7m 18s
  6. 45m 20s
    1. Grouping and sorting data
      4m 36s
    2. Understanding report structure
      6m 12s
    3. Building reports from wizards
      5m 0s
    4. Building reports from queries
      6m 34s
    5. Formatting conditionally
      6m 59s
    6. Calculating fields
      4m 35s
    7. Adding the finishing touches
      4m 49s
    8. Populating pre-printed documents
      6m 35s
  7. 15m 8s
    1. Printing reports
      3m 6s
    2. Tweaking the design
      7m 10s
    3. Automating the workflow with macros
      4m 52s
  8. 58s
    1. Next steps
      58s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Access 2010: Forms and Reports in Depth.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.