Useful Form_Toolbar Properties

All forms based on the Form_Toolbar class contain the useful properties described in the following subsections.

Tip: You should take the time to review the ďForm_Toolbar Class Properties and MethodsĒ section in the VPME 9.1 Technical Reference manual to learn about all the properties and methods available to you in the Form_Toolbar class.

Turning Off Related Forms for a Form - lRFDisable

When a form is activated, the VPM Enterprise Related Forms engine automatically checks to see whether the form is related to other forms already on the desktop if the formís lRFDisable property is set to .F., which is the default value.  (Related Forms are explained in the next chapter.)

Sometimes you may not want a form to be handled as a Related Form. If so, set the formís lRFDisable property to .T. When this property is set to .T., the Related Forms functionality of the form is disabled.

Multiple-Table Editing - cUpdateAliases

You can edit multiple one-to-one related tables on one form. The tables must have a one-to-one relationship and the relations must be set in the formís Data Environment. You can edit an unlimited number of one-to-one tables on one form with fields from the tables directly on the form or spread among pages in a pageframe. When you use the ProMatrix Basic Form Builder or PageFrame Builder, you can choose fields from the tables in the formís Data Environment and the Builder will handle everything for you. If you later want to add another table to the Data Environment and edit its fields on the form, you must update the cUpdateAliases property.

The cUpdateAliases property contains a comma-delimited list of the aliases other than the InitialSelectedAlias that should be updated when the Toolbar Save control is clicked. When you add another table to a form, add its alias to this propertyís list.

Controlling Automatic Adds - lAddWhenNoRecs

The lAddWhenNoRecs property controls whether you are automatically prompted to add a record when (a) a form is activated and there are no records or (b) the last record is deleted.

By default, this property is set to .T. and you are automatically prompted to add a record. Setting this property to .F. prevents the automatic prompt to add a record.

Controlling Automatic Add for Related Child Forms

The lAddWhenNoChildRecs property controls whether you are automatically prompted to add a record when (a) a Related Child Form is activated and there are no child records that match the current parent record or (b) the last matching child record is deleted.

By default, this property is set to .F. and you are not automatically prompted to add a record. Setting this property to .T. activates the automatic prompt to add a record.

Activating a Form in Add Mode Ė lStartWithAdd

If you need to open a form in ďadd modeĒ, set the formís lStartWithAdd property to .T. The default is .F. If you set lStartWithAdd to .T. through the form or through code, the form will open with a new blank record appended and ready for data entry.

Controlling Child Records in One-to-One Relations

The lRFAllowOneChildRec property prevents you from adding a second child record on a Related Forms child form. Itís default value is .F.

When set to .T., the Toolbar New and Copy controls are disabled to limit the number of child records on a Related Forms child form to one.

Use this property when a child table, view or CursorAdapter has a one-to-one relationship with its parent. The lRFAllowOneChildRec property set to .T. will prevent a user from erroneously adding a second record to the child table, view or CursorAdapter when itís form is displayed as a child Related Form.

Controlling the Audit Trail at the Form Level

By default the Audit Trail is turned on for data changes, record deletions and new records at the form level. However, you can set any or all of the following properties to .T. to turn off the creation of audit trail records for a specific form.

∑       lNoChangeAuditTrail: When set to .T., turns off the creation of audit trail records for changes to field values.

∑       lNoDeleteAuditTrail: When set to .T., turns off the creation of audit trail records for deleted records.

∑       lNoNewAuditTrail: When set to .T., turns off the creation of audit trail records for new records.

Running Objects from a Form - lSkipActivate

When an object is run that is outside a form (such as, a report or another form), the formís Activate event is run when returning. This is not normally desired because of the functionality performed, like asking if you want to save changes. Setting lSkipActivate to .T. in your code that runs an object will prevent the Activate event functionality from running.  The Activate event will reset lSkipActivate to .F.

 

More:

Useful Control Class Properties