Use the form to update the database

Note

Now you use the form to add a new contact to the database.

  1. Click the Run button.

    Run button

    Your finished form displays with data in place. The report on the form gives you a way to see all your contact data.

    Shown is a completed form titled Maintain Contact Information. At left are labeled text fields with actual data for a contact. Across the top right are buttons labeled Add a contact, Delete a contact, and Save changes. Under them is a scrollable table of contacts. Visible are columns of data labeled ID, Last Name, First Name, and Job Role.
  2. Click the Add a contact button in the form.

    An empty form displays. You use this form to enter a new contact.

    Shown is a form titled Maintain Contact Information. At left are blank text fields for entering data for a new contact. Across the top right are buttons labeled Add a contact, Delete a contact, and Save changes. Under them is a scrollable table of contacts. Visible are columns of data labeled ID, Last Name, First Name, and Job Role.

    The cursor is in the Id box, but you do not know the next available number. You look in the report to see what number was used last.

  3. In the report window, use the scroll bar to scroll down to the last row of the report and check the value in the Id column.

    If the data has not been changed since installation, the value is 60, so the next available number is 61.

    Shown is is a scrollable table of contacts. Visible are columns of data labeled ID, Last Name, First Name, and Job Role. The vertical scroll bar is positioned at the bottom, and the last row of data is for an ID of 60.
  4. Click the Id column and type 61.

    Shown is the top of the form titled Maintain Contact Information. The ID field is circled, and it displays the entry 61.
  5. Press Tab and type Clinton for Last Name.

    Press Tab and type George for First Name.

    Press Tab.

    At this point you are on the Job Role box. In this box you cannot type. You must select a job role from a list of possible ones.

    In the Database painter, the column was defined to be associated with a DropDownListBox edit style. The extended attribute system tables store this and other information about data.

  6. Click the down arrow on the drop-down list to display the choices.

  7. Select Marketing.

    Shown is the Maintain Contact Information form. The Job Role drop down list box is displayed, and the Marketing entry is highlighted.
  8. Press Tab and type Pennsylvania Ave for Street.

  9. Press Tab and type Houston for City.

  10. Press Tab and type T and select TX for State (another drop-down list).

  11. Press Tab.

    To determine what to enter for Zip, scroll the report until you find another Houston entry.

    Then click the Zip box in the form and type the zip code you see in the report.

    Shown is the Maintain Contact Information form with a rectangle around the Zip field. At right, in the report, a rectangle appears around a row with an address for Atlanta, Georgia. The same zip code for Atlanta is entered in the Zip field of the form.
  12. Press Tab and type 7135557833 for Phone.

    Notice that you type only the digits. The form formats the phone number. An Edit Mask edit style was defined for this column to handle the formatting. This edit style is stored in the extended attribute system tables.

  13. Press Tab and type 7135554291 for Fax.

    This is what your screen should look like now.

    Shown is a completed Maintain Contact Information form showing the entries made in the tutorial steps that precede this illustration.
  14. Click the Save changes button in the form to update the database with the new contact.

    The database is updated.

    Note that the report always displays the information from the database when you start running the form. If you update the database, the report does not show the updates. To update the report, you return to the workspace and rerun the form.

  15. Click the Close button in the PainterBar to return to the Form painter workspace.

    Close button
  16. Click the Run button again and scroll the report to the 61st row in the report.

    Run button

    Notice that your report has been updated.

  17. Click the Close button in the PainterBar to return to the Form painter workspace.

    Close button
  18. Select File>Close from the menu bar.

    If you have not already saved the current version of the form, you are prompted to save changes.

  19. Click Yes.

    The Form painter closes.