4: Creating the Demonstration System Forms

4.7.5 Adding a Validation Form

As you will recall, the formfile subscrpt includes two forms, subscribers and subscriptions. The subscribers form includes name and address information for a subscriber. The subscriptions form displays a magazine’s code and title, the date on which the subscription started, and the number of issues left in the subscription. When entering a subscription, the magazine code is validated to make sure that the magazine record has already been entered into the data file mag, This is an excellent way to eliminate many data entry errors, but it also creates a minor inconvenience, in that the following steps must be performed if the magazine code is not known or forgotten by the user entering the subscription information:

1. Exit from the formfile subscrpt.

2. Access the mag formfile and find the magazine code.

3. Exit from the mag formfile.

4. Access the formfile subscrpt once again.

5. Query and find the appropriate subscriber’s record.

6. Switch to the subscriptions form and add the new subscription information.

It would be much more convenient if the magazine codes could be accessed while the user was still ‘in’ the subscriptions form (i.e., the subscriptions form was currently active and displayed on the screen). This can be done if a validation form for the magazine field is created. To create a validation form, simply create a new form (within the same formfile) that contains the appropriate fields and enter that form’s name (once again arbitrarily chosen by you) in the Validation Form field of the Field Description screen of the field being validated. A validation form is created in the same way any other form is created. In our example, a validation form named magazine will be added to the subscrpt formfile, so that the codes to be entered in the magazine field may be validated prior to, rather than subsequent to, their entry.