(Note: I created the subform from within the main form. Would it have been easier to had I created my subform outside the main form then drag it into the main form and rename the new form accordingly? I've done both in Access - created a subform both within and outside of the main form and used D&D to insert it - but was wondering if Adabase would allow this as well.)
maybe i can show you with an example how to create such a subform.
Hope that's make all the things clear for you.
Create new tables:
Choose the "Tables" tab page in the "Data Source Administration" dialog.
Click the "New Table Design" icon on the "Tables" tab. The new,
independent "Table Design" window will appear.
For the first table, please define the following structure:
Field name Field type
-------------------------------------------
id Integer
firstname Text [VARCHAR] Length 100
name Text [VARCHAR] Length 100
street Text [VARCHAR] Length 100
postcode Text [VARCHAR] Length 10
city Text [VARCHAR] Length 100
Define the primary key for the "ID" field. The data can only be changed
if a primary key is defined for a table, the data can be changed:
Place the cursor in the gray area in front of the "ID" field and click
the right mouse button to open its context menu. Choose the entry
"Primary key" in this menu. Now save the table with the name "tablea"
and close the "Table Design" window.
For the second table, please define the following structure:
Field name Field type
-------------------------------------------
id Integer
firstname Text [VARCHAR] Length 100
name Text [VARCHAR] Length 100
street Text [VARCHAR] Length 100
postcode Text [VARCHAR] Length 10
city Text [VARCHAR] Length 100
index Integer
Define the primary key for the "INDEX" field. Place the cursor in the
gray area in front of the "INDEX" field and click the right mouse button
to open its context menu. In this context menu, choose the "Primary key"
entry. Now save the table with the name "tableb" and close the "Table
Design" window.
Confirm your input and close the "Data Sources" dialog with [OK].
Create a form:
Create a new text document and select the menu "View - Data Sources" (or
the [F4] key) to open the Data Source view. Open the newly created
database by clicking the plus sign (+) in front of the "Tables" entry.
Click the subentry "Admin.tablea". This table will now appear in the
right-hand side of the window.
Inserting Database Form fields:
To insert a form field into the document, select the column header with
the left mouse button while pressing [Ctrl]+[Shift] and drag and drop
the column header into the document. A label field and the corresponding
text field are now automatically inserted into the document. This
element can now be moved/placed within your document with the mouse
cursor. Repeat this procedure for all fields that should appear in your
form.
Next click on the "Form" icon in the toolbar and drag the (floating)
toolbar into the document to use later on.
Select the "Form Navigator" icon in the newly placed Form bar. The Form
Navigator will appear. Choose the "Admin.tablea1" entry in the Form
Navigator with the right mouse button to open its context menu. In this
menu, select "New - Form". A second area will now be created under the
existing form. Important is that the second form is created below the
first form, otherwise a table connection cannot be established.
Select the new entry in the Form Navigator click the "Table Control
field" icon in the Form bar. With the left mouse button, drag an area
within the document where the table should be placed.
The "Table elements data" AutoPilot will now appear. Choose the newly
created database connection as data source and the entry "Admin.tableb"
under Tables. Afterwards, click [Next >>]. In the next page, click [=>>]
to take over all fields. Finally, choose [Create].
Select the table element, click the right mouse button to open its
context menu and choose the "Form" entry. In the appearing "Form
Properties" dialog, click the "Data" tab page and enter the following
settings:
Data source = name of the newly created database connection
Content type = SQL command
Content = select * from tablea where id = :fid
Link from = id
Link to = fid
Close the "Form Properties" dialog and save the form. Click "Design mode
on/off" icon in the Form bar. The corresponding data will now be shown
in the lower table in conjunction to "tablea". Close the Data Source
view with "View - Data Source" (or the [F4] key).
Changes to the data can now be made in the form fields as well as in the
table element.
Please note:
As long as the Data Source view is open, no changes can be made in the
form. StarOffice allows either changes to be made only in the open form
and closed Data Source view, or only in the open Data Source view and
closed form.
Navigating among the data records is possible with the Database bar. If
you place your cursor in one of the form fields you can jump to
different data records in the table with the Database bar. If you place
the cursor in the table element, you can jump to the different data
records with the Database bar.
Lee Brown wrote:
> I would like to know how to set the properties to a subform. Each time I try setting them, the the control (the subform) takes on the properties of the main form and vice versa. I've made sure to only have the subform highlighted and that the data source is the table for the subform, but the properties won't take. Can anyone help me figure this out?
>
> (Note: I created the subform from within the main form. Would it have been easier to had I created my subform outside the main form then drag it into the main form and rename the new form accordingly? I've done both in Access - created a subform both within and outside of the main form and used D&D to insert it - but was wondering if Adabase would allow this as well.)
--
Lars Roesmann
Sun StarNews Support
--
All responses posted to this newsgroup are provided without guarantees
as to the suitability of their use. Although we believe the solutions or
explanations given to be accurate and correct, we cannot guarantee the
accuracy of the information contained.
Please do not reply directly to this e-mail address if you wish to
continue further dicussion of this matter, as you will only receive an
automatic response from our system. Instead, please reply to the message
itself so further assistance can be provided via the newsgroup.
Alternatively, you are welcome to have a look at our website for further
information regarding our support services, which is available at
http://www.sun.com/star/support