Locked lesson.
About this lesson
Continue editing the form in Design View.
Exercise files
Download this lesson’s related exercise files.
7.07 forms-in-design-view-part2 - Exercise.docx43.4 KB 7.07 forms-in-design-view-part2 - Exercise solution.docx
66.4 KB TechGurusTicketing19.accdb
820 KB TechGurusTicketing19 - Complete.accdb
828 KB
Quick reference
Forms in Design View - Part 2
In this lesson, we are going to continue working on the form we started in the last lesson.
When to use
Form Design is a fundamental skill if we want to create user-friendly forms.
Instructions
Designing a Form
- Re-open 'frmTicketDesign'.
- Right-click on the form tab and select Design View.
- From the Field List, double-click to add the 'ID' field.
- Reposition the field at the top of the form. Rearrange other fields where required.
- Drag the 'TicketNumber' field to the top so both the 'ID' field and the 'TicketNumber' field are on one row.
- Select all fields in the top row.
- From the Arrange tab, in the Sizing & Ordering group, click Align.
- Choose Align Top.
It's not necessary to have a label for every field. These can be deleted if required.
- Select the 'ID' and 'TicketNumber' label.
- Press the Delete key.
- Reposition 'ID' and 'TicketNumber'.
- Right-click on the form tab, and select Form View.
- Review the changes.
Tab Order
Notice where the cursor defaults to in Form View. It might be, that we need to change this and pull the focus to another field. If we press the TAB key to move through the form fields, it might also be that it doesn't TAB in the correct order. We can change this.
- Right-click on the form tab and select Design View.
- From the Form Design ribbon, in the Tools group, click Tab Order.
This will show the tab order of the fields. The field at the top of the list is the field that the cursor will default to when we load the form.
- Drag the 'ID' field to the top of the list.
- Click OK.
- Right-click on the form tab and select Form View.
- Press the TAB key to see the new tab order.
- Make any changes where necessary.
Headers and Footers
We can add headers and footers to our form.
- From the Form Design ribbon, in the Header / Footer group, click Title.
This will add a title for the form. The form title will be the name of the form by default.
- Select the title and go to the Property Sheet.
- Change the Text Align field to Center.
Let's add a form footer.
- From the Form Design ribbon, in the Header / Footer group, click Date and Time.
- Select the short date format (25-Jan-22).
- De-select Include Time.
- Click OK.
- Cut and Paste the Date into the footer.
- Align the date to the left-hand side of the form footer.
Renaming the Form
- From the Navigation Pane, select the 'frmTicketMaintenance'.
- Right-click and select Rename.
- Rename the form to 'frmTicketMaintenance_old'.
- Click on 'frmTicketDesign'.
- Right-click and select Rename.
- Rename the form to 'frmTicketMaintenance'.
- 00:04 In this lesson, we're going to continue working on our form in Design View.
- 00:09 So let's reopen the form that we created in the last lesson.
- 00:14 And that is frmTicketDesign.
- 00:17 Double click to open.
- 00:19 Now, we're going to jump straight into Design View.
- 00:23 Now, notice out of all of these fields that we added in the last lesson,
- 00:28 we didn't add the ID field.
- 00:29 So let's add it now.
- 00:31 Double click on the field list to add that in.
- 00:34 Now, I'm going to need to do a little bit of rearranging here,
- 00:38 because I want the ID field to go at the top.
- 00:40 So I'm basically going to select everything on this table,
- 00:44 because I want to drag the whole lot down so that I have a bit more room.
- 00:48 So let's grab everything and pull it down.
- 00:53 Now, let's grab the ID field, and I'm going to put that at the top.
- 00:58 And let's move it over here.
- 01:03 Now, what I actually want is the ID field and the ticket number on that first row.
- 01:08 So let's drag these both up as well.
- 01:11 Go to the Arrange tab and use your alignment tools to align them to the top.
- 01:16 Let's now move CustomerName and Priority.
- 01:20 We can now move those along a little bit.
- 01:23 And this actually gives me a good opportunity to really give that customer
- 01:26 field a little bit more room.
- 01:27 So let's drag Priority along, and let's allow for those longer names.
- 01:33 And I think what I also might do here is position DateLogged up here as well.
- 01:39 And we're going to make this form a little bit bigger.
- 01:45 Let's make sure everything on this row is aligned.
- 01:48 Let's align it to the top.
- 01:52 And we're going to move Technician across a little bit as well.
- 01:56 We're going to make Description wider, so
- 01:59 everything's nice and tidy, and move SLA along also.
- 02:04 Now, it's worth noting here that you don't necessarily have to have a label for
- 02:09 every single field.
- 02:10 So if you feel that a label is completely unnecessary, you can just delete them out.
- 02:15 So what I'm going to do here is select the ID label and the Ticket Number label, and
- 02:19 we're just going to delete those.
- 02:21 So now, we're just going to have the ID field at the top, and
- 02:25 the TicketNumber next to it.
- 02:27 Let's quickly take a look at how that's looking in Form View.
- 02:32 Well, there we go.
- 02:33 I think that looks pretty good.
- 02:35 Now, one thing to notice now that we've switched into Form View,
- 02:39 notice where the cursor is currently.
- 02:41 The cursor focus is grabbed to the TicketNumber field, and
- 02:45 that's what's highlighted in the form.
- 02:47 Now, if you want the focus to be grabbed to the ID field, for
- 02:52 example, we could change what we call the tab order.
- 02:56 Now before we do that, I'm actually going to make this ID field a bit smaller
- 03:00 because this field is way too wide for its contents.
- 03:03 So let's switch back into Design View and
- 03:06 just make this ID field a little bit smaller.
- 03:13 There we go.
- 03:14 I think that looks a lot better.
- 03:15 So now, let's change where our cursor appears when we load up this form.
- 03:21 I want it to appear in the ID field as opposed to the TicketNumber field.
- 03:26 Let's jump back into Design View.
- 03:29 And if we go to the form design ribbon, over in the Tools group,
- 03:34 we have a tab order button.
- 03:36 And this really allows us to define which order we can tab through those fields.
- 03:42 So every time we press the Tab key, it will go to the next field in this list.
- 03:47 And if you want users to be able to tab in a very specific way when they're working
- 03:51 on a form, this is where you can come to customize that order.
- 03:54 And the focus will always be grabbed to the first field in this list.
- 03:59 So for us, that is TicketNumber.
- 04:01 Now, I'm going to change this, and I'm going to move ID up to the top.
- 04:05 So let's select the field, we grab, we drag, and we drop.
- 04:09 It is that simple.
- 04:11 Click on OK.
- 04:13 Now, if we switch into Form View, notice that the focus is grabbed in the ID field,
- 04:19 and I can tab through in the order specified in that tab list.
- 04:23 Now notice here, again, as I tab, what happens.
- 04:26 It goes from ID to TicketNumber, CustomerName, Priority, but
- 04:30 then it skips over DateLogged and goes straight to Technician.
- 04:34 So I want to move DateLogged above Technician in that tab order.
- 04:40 So let's go back to Design View >Tab Order, we're going to
- 04:44 grab the DateLogged field, and we're going to put that above Technician.
- 04:49 Click on OK.
- 04:50 And now, let's check to see if that's worked.
- 04:53 Let's press the Tab key, goes to Priority.
- 04:56 Now it goes to DateLogged, Technician, Description, Charge, and SLA.
- 05:00 Now, the final thing I want to show you in this lesson is just something else that
- 05:04 you can add to your form in Design View.
- 05:06 And that is a header and a footer.
- 05:08 So let's right click, and go to Design View.
- 05:12 And notice on the form design ribbon, we have a header and footer section.
- 05:17 So if I click on Title,
- 05:19 notice I now get the title of the form up in the top area here.
- 05:24 Now, I'm going to reposition the title of this form to the center.
- 05:29 So with the header selected, if we go over to the property sheet, and
- 05:33 where we have text align, I'm going to change this to center,
- 05:37 just to put that title in the middle.
- 05:39 And just to make sure it's in the middle, if we drag the text box it's contained in
- 05:44 all the way out, that's going to put that in the center.
- 05:47 Now currently,
- 05:48 it says frmTicketDesign, which isn't a particularly meaningful name for a form.
- 05:52 We are going to change that in a moment.
- 05:54 Now, I'm going to go to the bottom of the form.
- 05:56 Notice we have a form footer, and just above there,
- 05:59 I'm going to drag the bottom of this form up.
- 06:02 So let's now add something into the form footer.
- 06:05 I'm going to add date and time.
- 06:08 Now, here I can choose if I want to include both the date and
- 06:12 the time or just one.
- 06:13 So I just want the date, and I want it to be in this format just here.
- 06:18 Let's click on OK.
- 06:20 Now notice by default, it's put it up in the header, and
- 06:24 it's kind of behind where we have our title.
- 06:27 So, I've clicked to select it, I'm going to do Ctrl+X to cut it.
- 06:32 Let's click down in the footer, Ctrl+V to paste.
- 06:36 I'm then going to drag this textbox along, and
- 06:39 we're going to align the date to the left-hand side.
- 06:43 So in the Property Sheet, where we have text align, let's change this to left.
- 06:49 And notice that when it's put in this footer, this date,
- 06:53 it's using a piece of code or it's using a built-in function in access.
- 06:57 So let's take a look at what our form currently looks like.
- 07:01 And there we go.
- 07:02 We have our title at the top, and we have our date down the bottom in the footer.
- 07:06 Now, this is actually going to be our ticket maintenance form.
- 07:10 But notice that we already have a form called frmTicketMaintenance in our
- 07:15 forms list.
- 07:16 So what I'm going to do here is I'm going to select the old ticket maintenance
- 07:21 form, and we're just going to rename this and add on the end _old.
- 07:26 And what I'm now going to do is rename this form to frmTicketMaintenance.
- 07:31 So let's close this down.
- 07:33 I'm going to say Yes to save the changes.
- 07:35 And now, we can right click, Rename,
- 07:38 frm, TicketMaintenance.
Lesson notes are only available for subscribers.