home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle 2002 #3 / K-CD-3-2002.ISO / OpenOffice / f_0066 / common.jar / text / common / 02 / 01170203.xml < prev    next >
Encoding:
Extensible Markup Language  |  2001-09-11  |  35.5 KB  |  285 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <html><head><title>Data</title><meta name="filename" content="text/common/02/01170203"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
  3.  
  4.         table.Tabelle2{
  5.                 }
  6.         span.Tabelle2A{
  7.                 width:1.499cm;}
  8.         span.Tabelle2B{
  9.                 width:16.498cm;}
  10.         tr.Tabelle21{
  11.                 }
  12.         td.Tabelle2A1{
  13.                 }
  14.         table.Tabelle1{
  15.                 }
  16.         span.Tabelle1A{
  17.                 width:1.499cm;}
  18.         span.Tabelle1B{
  19.                 width:16.498cm;}
  20.         tr.Tabelle11{
  21.                 }
  22.         td.Tabelle1A1{
  23.                 }
  24.         table.Tabelle3{
  25.                 margin-left:0cm; margin-right:0.005cm;}
  26.         span.Tabelle3A{
  27.                 width:3.916cm;}
  28.         span.Tabelle3B{
  29.                 width:14.074cm;}
  30.         td.Tabelle3A1{
  31.                 }
  32.         td.Tabelle3B1{
  33.                 border-width:0.002cm; border-style:solid; border-color:#000000;}
  34.         td.Tabelle3A2{
  35.                 }
  36.         td.Tabelle3B2{
  37.                 }
  38.         table.Tabelle4{
  39.                 }
  40.         span.Tabelle4A{
  41.                 width:1.499cm;}
  42.         span.Tabelle4B{
  43.                 width:16.498cm;}
  44.         tr.Tabelle41{
  45.                 }
  46.         td.Tabelle4A1{
  47.                 }
  48.         p.P1{
  49.                 }
  50.         p.P2{
  51.                 }
  52.         p.P3{
  53.                 }
  54.         p.P4{
  55.                 }
  56.         p.P5{
  57.                 }
  58.         p.P6{
  59.                 }
  60.         p.P7{
  61.                 }
  62.         p.P8{
  63.                 }
  64.         p.P9{
  65.                 }
  66.         p.P10{
  67.                 }
  68.         p.P11{
  69.                 }
  70.         p.P12{
  71.                 }
  72.         span.T1{
  73.                 font-weight:bold;}
  74.         span.fr1{
  75.                 }
  76.         </style></head><body>
  77.   
  78.   
  79.   <help:to-be-embedded Eid="daten" xmlns:help="http://openoffice.org/2000/help">
  80.   <p class="Head1"><help:key-word value="forms; data" tag="kw65955_1"/><help:key-word value="data; forms" tag="kw65955_6"/><help:key-word value="forms; subforms" tag="kw65955_5"/><help:key-word value="subforms; forms" tag="kw65955_4"/><help:link Id="65955">Data</help:link></p>
  81.   <p class="Paragraph">On this tab page define the form properties referring to the database that is linked to the form.</p>
  82.   </help:to-be-embedded>
  83.   <p class="Paragraph">Define here the data source on which the form should be based or if the data from thze form's user can be manipulated. Apart from the sort and filter functions, you will also find all the necessary properties to create a <help:link Id="65955" Eid="unterformular" xmlns:help="http://openoffice.org/2000/help">subform</help:link></p>
  84.   <help:popup Id="65594" Eid="formulareigenschaftendaten" xmlns:help="http://openoffice.org/2000/help"><help:embedded Id="65598" Eid="wie"/></help:popup>
  85.   <table><tr class="Tabelle21"><th class="Tabelle2A1" style="text-align:left;"><span class="Tabelle2A">
  86.       <p class="Paragraph"><draw:image draw:style-name="fr1" draw:name="HIND_2" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="1" xlink:href="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onRequest" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
  87.       </p>
  88.      </span></th><th class="Tabelle2A1" style="text-align:left;"><span class="Tabelle2B">
  89.       <p class="Paragraph">If the form is based on an SQL statement (see <span class="T1">Data Source</span> property) the filter and sort functions are available only if the SQL statement refers to a table and is not written in the database's native SQL.</p>
  90.      </span></th></tr></table>
  91.   <p class="Paragraph"/>
  92.   <p class="Head2"><help:help-id value="HID_PROP_DATASOURCE" xmlns:help="http://openoffice.org/2000/help"/>Database</p>
  93.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Define the database containing the data source to which the form should refer.</help:help-text> If you click the<span class="T1"> ...</span> button, you call the dialog <help:link Id="65703" xmlns:help="http://openoffice.org/2000/help"><span class="T1">Open</span></help:link>, where you can choose the desired data base.</p>
  94.   <p class="Head2"><help:help-id value="HID_PROP_CURSORSOURCE" xmlns:help="http://openoffice.org/2000/help"/><a name="datenquelle"/>Data source</p>
  95.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Determine the data source to be used for the form. The data source can be an existing table or a query (previously created in the database) or, it can be defined by an SQL-statement. Before you enter a data source you have to define the exact type in <span class="T1">Type of data source</span>.</help:help-text></p>
  96.   <p class="Paragraph">Forms that have been assigned to a database, that is to say that have been created in the form container of the database by using the command <span class="T1">New - Form</span>, will always belong to that database. The data source used for these forms cannot be changed at a later point in time. This is only possible (and necessary) if you use the floating toolbar <span class="T1">Form Functions</span> to convert a "normal" document into a form.</p>
  97.   <p class="Paragraph">If you have selected either the option "Table" or "Query" under <span class="T1">Type of Data Source</span>, the combo box lists all the exists data sources of this type, i.e. all tables and queries set up in the selected database. Let's assume you have selected the example database "Video Collection" under <span class="T1">Database</span> and the option "Table" under <span class="T1">Type of Data Source</span>, you can now select one of the example tables (e.g. "Cassettes" or "Films"). If you want the form to refer to a query, you first have to select the option "Query" as type of data source.</p>
  98.   <p class="Paragraph">You can also enter an SQL statement in the <span class="T1">Data Source</span> box, if you have selected the "SQL" option as the data source type. This statement is used to create an SQL query, which is used as a basis for generating the form or for defining a <help:link Id="65955" Eid="unterformular" xmlns:help="http://openoffice.org/2000/help">subform</help:link>.</p>
  99.   <p class="Head2"><help:help-id value="HID_PROP_CURSORSOURCETYPE" xmlns:help="http://openoffice.org/2000/help"/>Type of data source</p>
  100.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Define whether the data source is to be an existing database table or query or if the form is to be generated based on an SQL statement.</help:help-text></p>
  101.   <p class="Paragraph">If you choose "Table" or "Query", the form will refer to the existing table or query that you specify under <span class="T1">Data Source</span>. If you want to create a new query or a <help:link Id="65955" Eid="unterformular" xmlns:help="http://openoffice.org/2000/help">subform</help:link>, then you have to choose the "SQL" option. You can then enter the statement for the SQL query or the subform directly in the <span class="T1">Data Source</span> box. The form is then generated on the basis of the specified statement.</p>
  102.   <p class="Head2"><help:help-id value="HID_FM_PROPDLG_TABCTR" xmlns:help="http://openoffice.org/2000/help"/>Analyse SQL statement</p>
  103.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">If you choose SQL statement under Data Source, decide if the SQL statement is to be analyzed (yes) or not (no) here.</help:help-text></p>
  104.   <p class="Head2"><help:help-id value="HID_PROP_FILTER_CRITERIA" xmlns:help="http://openoffice.org/2000/help"/><a name="filter"/>Filter</p>
  105.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Enter the required conditions for filtering the data in the form. The filter specifications follow SQL-rules without using the WHERE clause.</help:help-text> For example, if you want to display all records with the "Mike" forename, simply enter in the data field Forename = 'Mike'. You can also combine conditions: Forename = Mike OR Forename = Peter, all records with these two conditions will be displayed.</p>
  106.   <p class="Paragraph">The filter function is available in user mode through the <help:link Id="65981" xmlns:help="http://openoffice.org/2000/help"><span class="T1">AutoFilter</span></help:link> and <help:link Id="65999" xmlns:help="http://openoffice.org/2000/help"><span class="T1">Standard Filter</span></help:link> icons on the <help:link Id="65578" xmlns:help="http://openoffice.org/2000/help">form bar</help:link>.</p>
  107.   <p class="Head2"><help:help-id value="HID_PROP_SORT_CRITERIA" xmlns:help="http://openoffice.org/2000/help"/><a name="sortierung"/>Sort</p>
  108.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">You can enter the desired conditions to sort the data in the form. The specification of the sorting conditions follows SQL rules without the use of the ORDER BY clause.</help:help-text> For example, if you want all registers of a data base to be sorted on one field in an ascending order and on other field in a descending order, enter (Name of field 1) ASC, (Name of field 2) DESC.</p>
  109.   <p class="Paragraph">The appropriate icons on the <help:link Id="65578" xmlns:help="http://openoffice.org/2000/help">Forms bar</help:link> can be used in User mode to sort: <help:link Id="65990" xmlns:help="http://openoffice.org/2000/help"><span class="T1">Sort Ascending</span></help:link>, <help:link Id="65969" xmlns:help="http://openoffice.org/2000/help"><span class="T1">Sort Descending</span></help:link>, <help:link Id="66041" xmlns:help="http://openoffice.org/2000/help"><span class="T1">Sort</span></help:link>.</p>
  110.   <p class="Head2"><help:help-id value="HID_PROP_DATAENTRY" xmlns:help="http://openoffice.org/2000/help"/>Add data only</p>
  111.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Determine here if the form should only permit the addition of new data (Yes) or if it should permit other properties (No).</help:help-text></p>
  112.   <table><tr class="Tabelle11"><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1A">
  113.       <p class="Paragraph"><draw:image draw:style-name="fr1" draw:name="HIND_1" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="0" xlink:href="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onRequest" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
  114.       </p>
  115.      </span></th><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1B">
  116.       <p class="Paragraph">Notice that changing or deleting previously added data is not possible. You can only add data since you can not view the already existing records.</p>
  117.      </span></th></tr></table>
  118.   <p class="Paragraph"/>
  119.   <p class="Head2"><help:help-id value="HID_PROP_NAVIGATION" xmlns:help="http://openoffice.org/2000/help"/>Navigation</p>
  120.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Decide if the navigation functions in the form bar can be used in the lower margin of the form (Yes) or not (No).</help:help-text></p>
  121.   <p class="Paragraph">The "Parent Form" option is used for subforms. If you choose this option for a subform you can navigate using the records of the main form if the cursor is placed in the subform. Because a subform is linked to the main form by a 1:1 relationship, navigating within the subform does not make any sense. The navigation is always completed in the parent form.</p>
  122.   <p class="Head2"><help:help-id value="HID_PROP_CYCLE" xmlns:help="http://openoffice.org/2000/help"/>Cycle</p>
  123.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help"> Determine here if the navigation should be done using the tab key.</help:help-text> Using the tab key you can move forward in the form. If you simultaneously press the Shift key, the Navigation will follow the opposite direction. If you reach the last (or the first) field and press again the the tab key, it can have various effects. Define the key control with the following options:</p>
  124.   <table border="1" bordercolor="#000000" cellpadding="2" cellspacing="0" page-break-inside="page-break-inside:avoid"><tr class=""><th class="Tabelle3A1" style="text-align:left;"><span class="Tabelle3A">
  125.       <p class="TableHead"><span class="T1">Option</span></p>
  126.      </span></th><th class="Tabelle3B1" style="text-align:left;"><span class="Tabelle3B">
  127.       <p class="TableHead"><span class="T1">Meaning</span></p>
  128.      </span></th></tr><tr class=""><td class="Tabelle3A2" style="text-align:left;"><span class="Tabelle3A">
  129.      <p class="TextInTable">Default</p>
  130.     </span></td><td class="Tabelle3B2" style="text-align:left;"><span class="Tabelle3B">
  131.      <p class="TextInTable">This setting automatically defines a cycle which follows an existing database link: If the form contains a database link, the Tab key will, by default, initiate a change to the next or previous record on exit from the last field (see All Records). If there is no database link the next/previous form is shown (see Current Page).</p>
  132.     </span></td></tr><tr class=""><td class="Tabelle3A2" style="text-align:left;"><span class="Tabelle3A">
  133.      <p class="TextInTable">All Records</p>
  134.     </span></td><td class="Tabelle3B2" style="text-align:left;"><span class="Tabelle3B">
  135.      <p class="TextInTable">This option applies to database forms only and is used to navigate through all records. The current record is changed on exit from the last field of a form via the Tab key.</p>
  136.     </span></td></tr><tr class=""><td class="Tabelle3A2" style="text-align:left;"><span class="Tabelle3A">
  137.      <p class="TextInTable">Current Record</p>
  138.     </span></td><td class="Tabelle3B2" style="text-align:left;"><span class="Tabelle3B">
  139.      <p class="TextInTable">Similarly, this option applies to database forms only and is used to navigate within the current record. The current record is kept on exit from the last field of a form via the Tab key.</p>
  140.     </span></td></tr><tr class=""><td class="Tabelle3A2" style="text-align:left;"><span class="Tabelle3A">
  141.      <p class="TextInTable">Current Page</p>
  142.     </span></td><td class="Tabelle3B2" style="text-align:left;"><span class="Tabelle3B">
  143.      <p class="TextInTable">On exit from the last field of a form the cursor skips to the first field in the next form. This is standard for HTML forms; therefore, this option is especially relevant for HTML forms.</p>
  144.     </span></td></tr></table>
  145.   <p class="Paragraph"/>
  146.   <p class="Head2"><help:help-id value="HID_PROP_ALLOW_ADDITIONS" xmlns:help="http://openoffice.org/2000/help"/>Allow additions</p>
  147.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Determine if data can be added (Yes) or not (No).</help:help-text></p>
  148.   <p class="Head2"><help:help-id value="HID_PROP_ALLOW_EDITS" xmlns:help="http://openoffice.org/2000/help"/>Allow modifications</p>
  149.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help"> Determine here if the data can be modified (Yes) or not (No).</help:help-text></p>
  150.   <p class="Head2"><help:help-id value="HID_PROP_ALLOW_DELETIONS" xmlns:help="http://openoffice.org/2000/help"/>Allow deletions</p>
  151.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">Determine here if the data can be deleted (Yes) or not (No).</help:help-text></p>
  152.   <p class="Head2"><help:help-id value="HID_PROP_MASTERFIELDS" xmlns:help="http://openoffice.org/2000/help"/>Link master fields</p>
  153.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">If you create a <help:link Id="65955" Eid="unterformular">subform</help:link>, enter here the data field of the parent form responsible of the synchronization between parent and subform.</help:help-text> If you would like to enter various values, press <help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="MAC">Command</help:case><help:default>Ctrl</help:default></help:switch> + Enter key after each input line.</p>
  154.   <p class="Paragraph">The subform is based on a <help:popup Id="65619" Eid="sql" xmlns:help="http://openoffice.org/2000/help">SQL</help:popup> query; more specifically, on a <help:link Id="66162" Eid="parameterabfrage" xmlns:help="http://openoffice.org/2000/help">Parameter Query</help:link>. If a field name is entered in the <span class="T1">Link master fields</span> field, the data contained in that field in the main form are read to a variable that you must enter in <span class="T1">Link slave fields</span>. In an appropriate SQL statement, this variable is compared to the table data the subform refers to. This procedure determines the type of display in the subform.</p>
  155.   <p class="Paragraph">Consider the following example:</p>
  156.   <p class="Paragraph">The databank table on which the form is based is, for example, a customer database ("Customer"), where every customer has been given a unique number in a data field named "Cust_ID". A customer's orders are maintained in another database table. You now want to see each customer's orders after entering them into the form. In order to do this you should create a subform and under <span class="T1">Link master fields</span> enter the data field from the customer database which clearly identifies the customer, i.e. "Cust_ID" (without quotes). Under <span class="T1">Link slave fields</span> enter the name of a variable which is to accept the data of the field Cust_ID, e.g. "x"</p>
  157.   <p class="Paragraph">The subform should show the appropriate data from the orders table ("Orders") for each customer or customer ID (Customer_ID -> x). Of course this is only possible if each order is uniquely assigned to one customer in the orders table. Alternatively, you can use a field called "Cust_ID"; to make sure that this field is not confused with the field from the main form (which we will assume is called "Customer_ID").</p>
  158.   <p class="Paragraph">Now you simply compare the "Cust_ID" in the "Orders" table with the "Customer_ID" from the "Customers" table, which can be done using the x variable, e.g. with the following SQL statement:</p>
  159.   <p class="Paragraph">SELECT * FROM Order WHERE Cust_ID =: x (if you want the subform to show all data from the orders table)</p>
  160.   <p class="Paragraph">or:</p>
  161.   <p class="Paragraph">SELECT Item FROM Orders WHERE Cust_ID =: x (if you want the subform from the orders table to show only the data contained in the "Item" field)</p>
  162.   <p class="Paragraph">The SQL statement can either be entered in the <span class="T1">Data Source</span> field, or you can create an appropriate parameter query, which can be used to create the subform.</p>
  163.   <p class="Head2"><help:help-id value="HID_PROP_SLAVEFIELDS" xmlns:help="http://openoffice.org/2000/help"/>Link slave fields</p>
  164.   <p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">If you create a subform, enter here the variable where possible values from the parent form field can be stored.</help:help-text> If a subform is based on an existing query, enter here the variable that you defined in the query. If you create a form using an SQL statement, entered in the <span class="T1">Data source</span> field, enter the variable you use in the statement. You can freely choose the variable name. If you want to enter various values, press <help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="MAC">Command</help:case><help:default>Ctrl</help:default></help:switch> + Enter.</p>
  165.   <p class="Paragraph">If, for example, you specified the "CustomerID" database field as a parent field under <span class="T1">Link master fields</span>, then you can define under <span class="T1">Link slave fields</span> the name of the variable in which the values of the "CustomerID" database field are to be read. If you now specify an SQL statement in the <span class="T1">Data Source</span> box using this variable, the relevant values are displayed in the subform.</p>
  166.   <p class="Head2"><a name="unterformular"/>What is a subform?</p>
  167.   <p class="Paragraph">Forms are created based on a database table or database query. They display the data in a graphical fashion and can be used to enter new data or change existing data which is then stored in the database table or query used as the basis of the form.</p>
  168.   <p class="Paragraph"><help:to-be-embedded Eid="wozu" xmlns:help="http://openoffice.org/2000/help">Should you require a form, which not simply refers to the data in a table or query but which is also to display data in another table, then you can create a subform in your form.</help:to-be-embedded> This subform may comprise a text box, for example, which records the data of a second database table.</p>
  169.   <p class="Paragraph">A subform is nothing more than an "additional component of the main form". The "main form" is termed the "superior form". When created, it is based on a database table containing the more important form data, all the other data administered in a database table is used to form an additional component: the subform. Subform are also needed as soon as you want to access more than one table from a form. Each table requires its own subform.</p>
  170.   <p class="Paragraph">A subform is seen as such by the user. The user only sees a form in which data is entered or where existing data is displayed. Using this form and subforms, it is possible to generate a simple customized input mask for the user, irrespective of how the data is managed in the database.</p>
  171.   <p class="Head3"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN"><help:key-word value="subform; creating" tag="kw65955_3"/><help:key-word value="forms; creating subforms" tag="kw65955_2"/>How to create subforms.</help:case></help:switch></p>
  172.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">In order to be able to create a subform you need to have created a form, e.g. based on a database table. You can create a form by using the AutoPilots or "manually". Below we will show you by means of example database "Video Collection", how you can create a subform for the "Movies" form. </help:case></help:switch></p>
  173.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Before starting the exercise, you can first make a copy of the form if you do not want to change the original.</help:case></help:switch></p>
  174.   <ul class="L1">
  175.    <li class="">
  176.     <p class="P2"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Open the forms container of the sample database called "Video Collection".</help:case></help:switch></p>
  177.    </li>
  178.    <li class="">
  179.     <p class="P2"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Use the mouse to drag the form called "Movies" to the forms container, and then release the mouse button.</help:case></help:switch></p>
  180.    </li>
  181.    <li class="">
  182.     <p class="P2"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">A dialog appears where you must enter a name under which to store the copy. In this example, enter "Exercise".</help:case></help:switch></p>
  183.    </li>
  184.   </ul>
  185.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">You have now created a copy of the form and can experiment with it.</help:case></help:switch></p>
  186.   <ul class="L2">
  187.    <li class="">
  188.     <p class="P3"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Open the exercise form, click the <span class="T1">Edit</span> icon and, for example, select the top text box in the form.</help:case></help:switch></p>
  189.    </li>
  190.   </ul>
  191.   <ul class="L3">
  192.    <li class="">
  193.     <p class="P4"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Select the control and choose <span class="T1">Format - Form</span>. Alternatively, you can choose the <span class="T1">Form</span> command on the control's context menu. A dialog will open, displaying the <help:link Id="65960">Form Properties</help:link>. The form name appears on the <span class="T1">General</span> tab: "Standard".</help:case></help:switch></p>
  194.    </li>
  195.    <li class="">
  196.     <p class="P4"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Open the <help:link Id="65950">Form Navigator</help:link> using the Object bar icon of the same name. Form Navigator lets you view all forms for the current document. In the example, this includes the "Standard" form of the sample database.</help:case></help:switch></p>
  197.    </li>
  198.   </ul>
  199.   <ul class="L4">
  200.    <li class="">
  201.     <p class="P5"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Select the <span class="T1">Data</span> tab of the <span class="T1">Form Properties</span> dialog. (If necessary, you must first select the "Standard" form in the Form Navigator so that the assigned properties can be displayed in the dialog.) The <span class="T1">Data</span> tab shows you how the form was created based on the "Movies" database table.</help:case></help:switch></p>
  202.    </li>
  203.   </ul>
  204.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">For every movie shown in the form, a control should now display the caption of the assigned video tape containing the movie. This caption is managed in the "Tapes" database table. You can create an appropriate subform.</help:case></help:switch></p>
  205.   <help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">
  206.   <table><tr class="Tabelle41"><th class="Tabelle4A1" style="text-align:left;"><span class="Tabelle4A">
  207.       <p class="Paragraph"><draw:image draw:style-name="fr1" draw:name="HIND_3" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="2" xlink:href="65980" xlink:type="simple" xlink:show="embed" xlink:actuate="onRequest" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
  208.       </p>
  209.      </span></th><th class="Tabelle4A1" style="text-align:left;"><span class="Tabelle4B">
  210.       <p class="Paragraph">The original form "Films" from the example database already contains a list box that shows the accompanying videocassette for each film. This list box is a part of the "Standard" logical form as you can see in the formula navigator. It is not carried out with a sub-form. The example database is thus designed using tabular definitions and relations between various tables so that data from various tables can also be displayed within a logical form. It should be displayed here how a sub-form is saved. We then later ignore the somewhat complicated structure of the example database.</p>
  211.      </span></th></tr></table>
  212.   </help:case></help:switch>
  213.   <ul class="L5">
  214.    <li class="">
  215.     <p class="P6"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Select the "Standard" entry in the Form Navigator and choose the <span class="T1">New - Form</span> command in the context menu. This creates a subform for the "Standard" form. This subform is empty since no controls have been defined for the form.</help:case></help:switch></p>
  216.    </li>
  217.    <li class="">
  218.     <p class="P6"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Open the <span class="T1">Form Functions</span> floating toolbar and add a text box to the form.</help:case></help:switch></p>
  219.    </li>
  220.   </ul>
  221.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">In the Form Navigator you can see how the new control is automatically assigned to the currently selected subform. Now, you need only fill the subform. Do this using the entries you make in the subform form properties on the <span class="T1">Data</span>tab.</help:case></help:switch></p>
  222.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">The text box of the subform should show the contents of the the "TName" database field from the "Tapes" database table if a movie name is displayed in the form. To do this, you have two basic options:</help:case></help:switch></p>
  223.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">You can</help:case></help:switch></p>
  224.   <ul class="L6">
  225.    <li class="">
  226.     <p class="P7"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">first create a query that shows the label for each video tape, and then create a subform based on this query, or </help:case></help:switch></p>
  227.    </li>
  228.   </ul>
  229.   <ul class="L7">
  230.    <li class="">
  231.     <p class="P8"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">you can create a subform in which an SQL statement is used to generate a query in order to create an appropriate label for each video tape.</help:case></help:switch></p>
  232.    </li>
  233.   </ul>
  234.   <p class="Head3"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Creating a subform using an SQL statement</help:case></help:switch></p>
  235.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">If you have not created a query for creating the subform, then enter the desired SQL statement directly on the <span class="T1">Data</span> tab:</help:case></help:switch></p>
  236.   <ul class="L8">
  237.    <li class="">
  238.     <p class="P9"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Open the subform <span class="T1">Data</span> tab by selecting the text box in Design mode and accessing the <span class="T1">Form...</span> command on the context menu.</help:case></help:switch></p>
  239.    </li>
  240.   </ul>
  241.   <ul class="L9">
  242.    <li class="">
  243.     <p class="P10"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Under <span class="T1">Database</span>, select the "Video Collection"</help:case></help:switch>.</p>
  244.    </li>
  245.    <li class="">
  246.     <p class="P10"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Under <span class="T1">Data Source Type</span> select "SQL". You can now enter an SQL statement for the subform.</help:case></help:switch></p>
  247.    </li>
  248.    <li class="">
  249.     <p class="P10"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Under <span class="T1">Data Source</span> for example, enter the following expression as an SQL statement (without quotation marks): "SELECT * FROM Tapes WHERE TID=:VariableX".</help:case></help:switch></p>
  250.    </li>
  251.    <li class="">
  252.     <p class="P10"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Under <span class="T1">Link master fields</span>, enter the field of the parent form which the subform should follow; i.e. "TID" (without quotation marks; these are automatically entered by OpenOffice.org Base).</help:case></help:switch></p>
  253.    </li>
  254.    <li class="">
  255.     <p class="P10"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Under <span class="T1">Link slave fields</span>, enter the variable name used in the SQL statement; in this case, "VariableX".</help:case></help:switch></p>
  256.    </li>
  257.   </ul>
  258.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Using the SQL statement above, select all fields from the "Tapes" database table, to view the data for each tape ID number TID. Only the content of a data field can be added to a text box. If you select the text box and choose the control properties (<span class="T1">Format - Control...</span> or context menu) you can use the <span class="T1">Data</span> tab to see if the "TName", "TLength", and "TID" data fields are available for selection. Select the "TName" data field here. (Of course, you can also compose the SQL statement that for each tape ID, the content of the "TName" data field is shown in the text box: "SELECT TName FROM Types WHERE TID=:VariableX".)</help:case></help:switch></p>
  259.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Close the Properties dialog of the form and deselect the edit mode by clicking the <span class="T1">Edit</span> icon on the toolbar. The form is finished with the subform, which shows the labeling of the video tape for each movie.</help:case></help:switch></p>
  260.   <p class="Head3"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Creating a subform based on a query</help:case></help:switch></p>
  261.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">To apply the above example to a subform, which is based on an existing query, you must first create an appropriate query. Subforms can be generated only with <help:link Id="66162" Eid="parameterabfrage">Parameter queries</help:link>. i.e. a variable must be defined for the query, from which the values for the subform can be read.</help:case></help:switch></p>
  262.   <ul class="L10">
  263.    <li class="">
  264.     <p class="P11"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">First create a query that shows the labels for each video tape and define a variable for the "TID" field, e.g. "xyz", by entering "=:xyz" or "=[xyz]" in the Query Design under <span class="T1">Criteria</span> (without quotation marks).</help:case></help:switch></p>
  265.    </li>
  266.   </ul>
  267.   <ul class="L11">
  268.    <li class="">
  269.     <p class="P12"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Open the window in Design mode, create a subform using a text box, and open the <span class="T1">Data</span> tab in the <span class="T1">Form Properties</span> dialog.</help:case></help:switch></p>
  270.    </li>
  271.    <li class="">
  272.     <p class="P12"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Under <span class="T1">Database</span>, select "Video Collection"</help:case></help:switch>.</p>
  273.    </li>
  274.    <li class="">
  275.     <p class="P12"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Under <span class="T1">Type of Data Source</span>, select the "Query"</help:case></help:switch>.</p>
  276.    </li>
  277.    <li class="">
  278.     <p class="P12"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Under <span class="T1">Data Source</span>, enter the name of the query you created.</help:case></help:switch></p>
  279.    </li>
  280.    <li class="">
  281.     <p class="P12"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Under <span class="T1">Link master fields</span>, enter the form in the field of the parent form which you want the subform to follow, i.e. "TID" (without quotation marks).</help:case></help:switch></p>
  282.    </li>
  283.   </ul>
  284.   <p class="Paragraph"><help:switch select="System" xmlns:help="http://openoffice.org/2000/help"><help:case select="WIN">Under <span class="T1">Link slave fields</span>, enter the variable name used in the query; in the example used, "xyz".</help:case></help:switch></p>
  285.  </body></html>