In the demonstration Orders database, the form used to display products has been created in just the same way. The only extra features are the PixMap control, which can be used to display the Image column from the Products table, and the multiline Memo control.
The next form is the orders form. This is a little more complicated, since it contains a subform within the main form. The main form shows a client; the sub-form shows all orders placed by the client (analagously, there could be a form whose mainform shows products, and whose sub-form shows all orders for that product).
The image below shows this form (which accesses the Client table), called Orders, just after the fields for the Client table have been added. For a bit of variety, the fields are all marked as read-only and have the text colour set to blue (so give the user some indication that they are read-only, of course you can use whatever colour you like, or maybe change the font).
The subform can now be added. Rekall uses the general term block to refer to things like subforms (and similar objects in reports). In fact, the entire form is itself a block. Sweep out a suitably large area and select New Block/Table Block. This brings up a dialog for the table which is to supply the information, in this case the Orders table. It is followed by a dialog for the block properties; the position and size will be set according to the area that you swept out; the other settings are shown below:
Property | Significance | Setting |
Row count | The number of rows of data to be displayed; zero will show multiple rows depending in the block size. later. | 0 |
X-delta | X-offset between data controls when more than one row is displayed. Not relevant if only one row is displayed. | 0 |
Y-delta | Y-offset between data controls when more than one row is displayed. Not relevant if only one row is displayed. | 20 |
Parent field | This is the name of an item of data retrieved in the query for the outer block, which is used to link data displayed in the inner block. | ClientID |
Child field | Similarly, a column in the query used for the inner block, which links to the outer block. | ClientID |
You may have noticed the Child Field property before when you created the outer block. This property is only used in nested (inner) blocks, unless you want to link separate forms together. This is described in chapter 13.
The next image shows the form after controls have been added to the inner block. The left-hand most control is a Row Mark, as seen in the table design form; the right-hand three controls and simple Fields. The second control is a Link, which displays a value from some other table according to a value in the form. When creating a link, two property dialogs will appear; their settings are shown below the image.
The tables below show the important properties for the inner block and its associated query.
Property | Significance | Setting |
Server name | server database name | Orders |
Table name | Name of the table from which a value will be displayed. | Products |
Unique key | A unique key column in the table. | ProductID |
Row order | Ordering expression for the SQL query used to retrieve and display in the inner block. | Description |
Property | Significance | Setting |
Control name | Name used when accessing the control from a script | Product |
Parent Field | Name of the column in the block which identifies a row in the Link control's table | ProductID |
Child field | Name of the column in the Link controls table used to link to the block | ProductID |
Display expression | SQL expression displayed in the Link control. | Description |