Creating a Form to Enter Data






Creating a Form to Enter Data

Now that the table has been created, we need a means for entering and accessing the data. Rekall uses forms for this purpose. As the name might suggest, these are like the paper forms filled in by people whenever data needs to be collected, such as tax returns, job applications, and so on.

Designing a Form

When creating a Rekall database, you must first design the form from scratch. Once this is done, the same form can be used over and over again to enter new data. Once a data set has been entered (for example, details of a CD in our sample database), the data is saved into the database, and then the form cleared, ready for new data.

Let's get started.

  1. Close the table-editing screen and return to the main Rekall window.

  2. Click Forms on the left, and then double-click the entry on the right relating to the filename you entered earlier.

  3. Select Create New Form with Wizard.

  4. Select the table you created earlier. This will most likely be automatically selected, so click Next.

  5. Select the data columns you created earlier, and then click the Add >> button so that they will be available on the form. You'll need to add one column at a time. However, be sure not to add the Primary Key data column. Figure shows the columns added to the form. Click Next when you're finished adding columns.

    Image from book
    Figure. Add all the data columns to the field, with the exception of the Primary Key.

  6. Now, you're invited to choose from various formats in which the data will be entered and displayed. For example, what format do you wants dates to be entered in? US or UK format? Just the year and month, or days as well? On the other hand, you can leave the drop-down lists alone if you prefer. Click Next when you're finished.

  7. You're asked how many records you want on a page. A record refers to a complete entry in your database, so in our example, it refers to an entry relating to a single CD. In our case, it makes sense to have only one record per form.

  8. The next step asks if you want any buttons on the page. These let the user move from record to record within the database, so they are very useful. Put ticks in both boxes.

  9. The final step is to give the form a name, which can be anything provided it's kept short and doesn't include spaces. After you enter a name, click the Finish button.

Rekall will now open the form you've created. You can then use this to enter data.

Adding Elements to a Form

You'll notice your form isn't quite right. We wanted a check box to appear near the Scratched heading, but currently we have a text box. Fortunately, you can edit the form components to add new buttons and text boxes. Let's add a check box.

  1. Close the form, and then right-click its entry in the main program window.

  2. Select Design View from the menu that appears.

  3. Select the Scratched box, right-click it, and select Delete. Then do the same for the actual data-entry text box.

  4. Right-click in a blank spot on the form and select New ® New Check. This will bring up a Properties window with many options that can be edited.

  5. Double-click the Control Name entry in the list and, in the text box, type the name of the data column you created to hold the data relating to whether the CD is scratched: Scratched. Your screen should look like Figure. Then click Accept.

    Image from book
    Figure. Enter the name of the data column you created under the Control Name and Display Expression headings.

  6. Repeat step 5 with the Display Expression header, so that it, too, contains the name of the data column. Then click OK.

  7. This will have created a check box so large that it dominates the form. Click and drag one of its corner handles to shrink it.

  8. The text box still needs something to identify it. It needs what's called a label. Right-click a blank spot within the form and select New ® New Label.

  9. Once again, this will show a Properties dialog box with many choices, but all we're interested in is the Label Text entry. Double-click this and type in a suitable name for the check box, such as Scratched?. Click OK.

  10. Like the added check box, the label takes up most of the space on the form. Click and drag the corner handles to shrink it down to the appropriate size. You can also click and drag it to the relevant spot on the form, as you can move the check box itself.

  11. Click the Save icon, and then close the form design window.

  12. Double-click the entry on the form so you can enter data. You should now find your check box works fine.

We've only scratched the surface of Rekall's power in this chapter. There are many more options, such as creating automated queries that can manipulate and search data in various ways. By clicking Help, you'll be able to read the Rekall manual, which is written in everyday English and doesn't assume the user understands very much about databases.



 Python   SQL   Java   php   Perl 
 game development   web development   internet   *nix   graphics   hardware 
 telecommunications   C++ 
 Flash   Active Directory   Windows