Jan's Illustrated Computer Literacy 101 Logo:Jegsworks Jan's Illustrated Computer Literacy 101


Home > Jan's CompLit 101 > Working with Databases > Basics > Access Objects > AutoForm
Icon: Arrow - Previous pagePrevious    NextIcon: Arrow - Next page

Jan's Working with Databases

   Basics: Access Objects: Create Form

An autoform is a quick way to create a basic form that you can then edit and format. But there are some tricky bits that are not very obvious at first.

AutoForm - starwars.accb (Access 2013)

A simple autoform is very easy to create using the Form button. (This button was called AutoForm in previous versions of Access.)

There are a number of things you could do to improve the layout, but for this lesson we mostly will settle for what Access provides. Later you will learn how to change all the characteristics of a form.

Access 2007, 2010, 2013, and 2016 create very similar forms. There are some small differences in spacing between controls and the size of the controls. The form icon in the form header is different in each version. The illustrations will use Access 2010 unless there is an important difference between versions. If an image has an error, I will usually replace it with an image from my current version.


Icon Step-by-Step 

Step-by-Step: Create a Form with AutoForm

 Icon Step-by-Step

What you will learn: to create a form with AutoForm
to navigate records and fields in a form in Layout and Form views
to switch to Form view
to use a form to add records
to create a hyperlink with display text
to use a form to edit records
to select a record in Form View
to copy a record and paste in Excel and Word

Start with: Icon: Class disk,Icon: Back Up disk, mytrips-Lastname-Firstname.accdb from previous lesson

Create a Form with AutoForm

  1. If necessary, open mytrips-Lastname-Firstname.accdb .
  2. Icon: Back Up diskBack up this database now.
    You can use this good copy to use if you need to start over.
    This works well while the database is small.

    Icon: Access 2007Access 2007: Button: Office > Manage > Back Up Database

    Icon: Access 2010 Access 2010: File > Save and Publish > Back Up Database > Save As button

    Icon: Access 2013 Icon: Access 2016 Access 2013, 2016: File > Save As > Back Up Database > Save As button

  3. In the Navigation Pane, if necessary, click on the table Trips to select it, but do not open the table.
    This table will be the source of records for the new form.

  4. Trips autoform (Access 2013)Click the Create ribbon tab and then on the Form button.
    Button: Form (Access 2010)Button: Form (Access 2016)
     
    The screen may blink while Access creates the form.
    The new form will open automatically to the first record in Icon: Layout View Layout View.

    Your screen may not show the property sheet.

  5. Dialog: Save As - Trips AutoForm  (Acces 2010)

    Icon: Class disk Save: Click the Save button Button: Save (Access 2010) Button: Save (Access 2013) Button: Save (Access 2016) on the Quick Access Toolbar.
    A dialog appears asking you to name the new form.

    TipSave As dialog is different: This Save As dialog is not like the one you see in programs like Word and Excel because you are saving your form inside the database file, not as a separate file.

  6. Name the form Trips AutoForm and click on OK.


Form View: Navigate Between Records

The form has the same Navigation Bar that datasheets have. You can also move through the records using the Page Up and Page Down keys on your keyboard. (The TAB, Home, and End keys move you between the controls on a form.)

  1. Icon: Experiment Experiment: Navigate the records
    • Navigation Bar (Access 2010)Click on each of the navigation buttons in the Navigation Bar at the bottom of the form window.
    • Type in a record number and press ENTER.  
    • Icon: Keyboard Press the Page Up and Page Down keys to navigate through the records.
    • Evaluate: Which method do you like best?
    • Use the method of your choice to return to the first record.
    • The records should be in order by TripID. If yours are not, use the Simple Solution below.

Icon: Trouble Problem: Records out of order or missing:
The table was saved with a sort and/or filter still active. The form is using the same sort and/or filter.

Simple Solution: Start over
Close the form. Delete the form. Open the underlying table in Table Datasheet View, remove any sorting or filters, add any sorting or filtering that you need, save the table. Recreate your AutoForm.
If you made a lot of changes to the form before noticing the sorting and filtering, you may want to use the Advanced Solution below.

AutoForm for a table that was sorted and filtered (Access 2013)Advanced Solution: Edit Property Sheet
Open the form in Design View or Layout View. Show the Property Sheet for the Form. Remove or edit the entries in the 'OrderBy' and 'Filter' properties. (This is the 'advanced' part!) Save the form again.

Changes to the table's datasheet sorting and filtering that you make after the form was created will not be used by the form automatically.


Layout View: Navigate the Fields in a Record

It is awkward to switch back and forth between the mouse and the keyboard. So how do you change from field to field with the keys?

  1. Icon: Layout View While in Layout View, if necessary, click on the TripID text box to select it.
    The selected control shows an orange border.
  2. Press the TAB key to move through the form until you change to the next record.
    Since you are in Layout View, the focus moves through all of the fields and their labels.
  3. Icon: Keyboard Use the key combo SHIFT + TAB to move backwards through the fields to the first field in the first record.

Form View: Switch Views and Navigate Records

  1. Switch to Form view.
    There are several ways to do that:
    • Ribbon: Button: Form View (Access 2010) Button: Form View (Access 201)
    • Statusbar: Button on Status bar: Form view (Access 2010) Button on Status bar: Form view (Access 2013) Button on Status bar: Form view (Access 2016)
    • Right Click Menu: Form View (Access 2013)Right click menu: Right click the form's tab and choose Form View from the context menu.
  2. Press the TAB key to move through the fields in the first record.
    In Form View the focus moves only through the fields, not the labels.  
  3. Icon: Keyboard Use the key combo SHIFT + TAB to move backwards through the fields to the first field in the first record.

TipTab Order: In an AutoForm the tab order for the fields is easy to understand - straight down the one column of fields. This is the same as the order of the fields in the table datasheet. This tab order can be changed. When you create a form yourself or move controls around, you may need to change the tab order so that the order you wind up with is logical.


Form View: Add Record

Now that you can get around in the records, it's time to add some more records.

  1. Click on the Button: Navigate to new record New Record button on the Navigation bar.
    A blank record appears in the form.
  2. Type Ireland in the TripName field.

    Icon: Trouble Problem: Typing is not accepted in field
    You are in Layout View instead of Form View. You cannot edit or add records in Layout view.
    Solution: Change to Form View.

  3. Type or copy and paste the following data into the appropriate fields.
    The Memo/Long Text fields will scroll when you reach the end of the space. Remember, you cannot enter anything in the TripID field because it is an AutoNumber field.
     
    TripName Ireland
    PhotoLink  
    DateStarted 6/4/1992
    DateEnded 6/17/1992
    Description Took the girls with us to convention in Ireland. Toured western Ireland.
    Cost $2,000.00
    Travel Agent Jorge Martinez, World Travel Inc, jmartinez@worldtravelinc.net
    Diary Arrived at Limerick airport. Rented a car. Hit the outside mirror on a dump truck before we got out of the airport! They drive on the left in Ireland. Terrifying!!

    As we drove, we kept seeing old ruined castles and abbeys. Beautiful scenery.

    Took the girls to see the Blarney stone. They kissed it. You have to bend over backwards!

    Had dinner at a restored medieval castle. Low doors, small rooms. Stone everywhere. Little furniture. They must not have had many clothes at all.
  4. Press TAB or click in a different record to save your new record automatically.

Form View: Create Hyperlink with Display Text

  1. Right Click Menu: Hyperllink > Edit Hyperlink (Access 2010)In the PhotoLink control, type Ireland. It is formatted to look like a link, Ireland,  but clicking it won't take you anywhere. You need to edit the link.
  2. Right click on the PhotoLink control and hover over Hyperlink  and then click on Edit Hyperlink .
    The Insert Hyperlink dialog appears. It does not matter what items show in the list of folders and files.
  3. Type, or copy and paste, the following URL into the Address box:
     http://jegsworks.com/Lessons/images/trips/ireland/ireland.htm

    Dialog: Insert Hyperlink

  4. Click on OK to close the dialog.
    The link Ireland looks the same but now it actually has a destination.  
  5. Screen tip shows the address that a link will take you toHover the mouse pointer over the link Ireland. A screen tip shows the address that the link will take you to.
  6. Click in the Diary control and press the TAB key.
    The form changes to the next record, which is a new blank record.
  7. Enter the data below for yet another trip record.
    As you enter text in a Memo/Long Text field, a scroll bar will appear at the far right of the text box, even if you don't need one yet.
     
    TripName Italy
    PhotoLink Use Italy as the Display Text
    Edit the hyperlink to use the URL below:
     http://jegsworks.com/Lessons/images/trips/italy/italy.htm
    DateStarted 5/11/2001
    DateEnded 5/21/2001
    Description Toured Rome and Pompeii and Venice.
    Cost $6000.00
    Travel Agent Hector Chavez, World Travel Inc, hchavez@worldtravelinc.net
    Diary Saw the Trivi Fountain, ate gelato (ice cream). Toured St. Peter's Basilica and the Sistene Chapel. Huge! Gorgeous now that most parts are restored.

    Pompeii was covered in volcanic ash for centuries. Many buildings have been excavated. Painted murals and mosaics abound.

    Venice has waterways for streets. Many tiny ones. Water taxis and gondolas. Did not ride a gondola. The water taxis are faster!

    Most people find that it is easier to enter data on a form than directly in a datasheet. What do you think?

  8. Save Record Button: Save Record (Access 2010) Button: Save Record (Access 2016) on Home ribbon tab in Records tab group.
    This button saves the current record without having to leave the record.

Form View: Edit Record

Everyone makes mistakes when entering new records. Fingers do their own thing sometimes. Even after you have carefully entered the information, it can be wrong one day. People get new phone numbers or move. Postal codes and telephone area codes change. At least it is easy enough to edit an existing record.

  1. If necessary, switch to the record of the Italy trip.
     If you typed the information for the records accurately, you have a spelling error.
  2. In the Diary memo field, click in the word "Trivi" between the r and the i.
  3. Press the Delete key to remove the i.
  4. Now type an e,  so that the word reads Trevi.
    There are likely more errors in more records. Spell Check is a big help!
  5. Click on Button: Spelling (Access 2010) the Spelling button in the Home ribbon tab, Records tab group.
    A dialog opens which will look for errors in all of the records.
    The first error may be the word you just corrected! Not all words are in the Office dictionary, especially names of places and people.
  6. Dialog: SpellingClick on Ignore for the offer to correct Trevi.
    The next suggested correction is to change "Sistene" to Sistine .
  7. Click on Change to accept the correction.

    There are a number of corrections to make as Spell Check goes through all of the records, if you typed what you were told to type or if you copied and pasted. Yes, there were deliberate errors included!!

    Some "errors" may not really be errors so read carefully what the original was and what correction is suggested.

  8. Dialog: Spelling is complete (Access 2010)Continue until all errors are corrected.
    The dialog closes itself and pops up a message that Spelling is complete.
  9. Click on OK.
    You are back in the form.
  10. Icon: Class disk Click the Save button make sure your last spelling correction is saved.


Form View: Select Record

The record selector is much taller than in a datasheet since the fields are now arranged vertically instead of in a row.

  1. Switch to record #4, the Family reunion.
  2. Click on the Record Selector, the tall bar at the left of the form. The bar turns black, indicating that the whole record is selected.

    WarningBe careful what you do while a record is selected! Deleting a record cannot be undone.

    AutoForm: selected record


Form View: Copy/Paste Record

The only reason to select a record is to do something with it! Deleting is easy. Just press the DELETE key. Copying and pasting are easy, but you must paste to the right kind of place - another table with the correct fields in the same order or to a blank document in another program, like a spreadsheet. Copy and paste is often the easiest way to move a small number of records between programs.

  1. Use the key combo CTRL + C to copy the record.
  2. Open Excel or another spreadsheet program to a blank spreadsheet.

  3. Click in the first cell at the top and paste with the key combo CTRL + V.

    Excel- pasted record

    Quite a mess but easy to fix. The columns are all the same width so the Memo/Long Text fields make the row very tall.

  4. Close Excel without saving unless your instructor wants to see this document.
  5. Switch back to Access and copy the record again.
    Once it was pasted, the Clipboard may have deleted it. That is common in some spreadsheets.
  6. Record pasted to Word 2010Open Word to a blank document and Paste.
    Word creates a table to hold the pasted record. Again, those Memo/Long Text data type fields create trouble in this kind of table.
  7. Close Word without saving your document unless your instructor wants to see this document.
  8. Click somewhere in the Trips AutoForm to deselect the record.
  9. Icon: Back Up diskBack up this database now so you will have a good copy to use if you need to start over. This works well while the database is small.

    Icon: Access 2007Access 2007: Button: Office > Manage > Back Up Database

    Icon: Access 2010 Access 2010: File > Save and Publish > Back Up Database > Save As button

    Icon: Access 2013 Icon: Access 2016 Access 2013, 2016: File > Save As > Back Up Database > Save As button