Switch to: V11V10V9V8V7V6V5

Form Editor - Source Editor Help

Each Form, Sub Form and TableView control has the Source property which defines the way how the records for showing are obtained.

There are three types of objects that can be defined as a records source:

  • Tables - the records come from the database table
  • Views - the records come from the database view
  • Queries - the records are returned by the query created on the Project tab.

The source editor has three tabs, one for each type.

Tables

The tab contains the tables that can be selected as a source.

Once some table is set as a source for the form, the list of tables will be divided into three groups:

  • Main Table - the main table of the form
  • Related Tables - the tables linked to the main table
  • Non-related Tables - the rest of tables

Views

The tab contains the views that can be selected as a source.

Queries

The tab contains the queries that can be selected as a source.

These queries must be created on the project tab for the current data source of the form.

The query may contain parameters defined using the $P macro, like:

SELECT * FROM actor WHERE actor_id > $P(pActorId)

For such query, it is necessary to set the parameter value using the setQueryParameterValue method of the form object.

For example, upon the showing the form.

this.setQueryParameterValue( 'Param1', 20 );

Or when the form is imported from another form:

import '/form_with_param' as dlg;
dlg.setQueryParameterValue( 'Param1', 20 );
dlg.exec();

Otherwise, the default parameter value is used.