John Toliver wrote:
On Wed, May 21, 2008 at 3:59 PM, Drew Jensen
<[EMAIL PROTECTED]> wrote:
Are all the tables related via the ID fields or are they separate?
jt-In what sense do you mean related? The ID field happens to
be(actually, for my purposes, it must be) identical in each table,
and, in fact I have a combo box pulling the data for the ID field from
another table so that the ID would be Identical. In other words it
may not be an ID in the true sense of the word, but an "attribute" or
"property" field. I would have many entries in the underlying table
with ID's that are the same. The reason I do this is to filter all
records by the field "ID" matching xyz criteria. This allows me to
later, view all records I've entered in any of the tables that match
for that "ID" field.
But in the other sense, I have not gone and created a query and made
"relationships" between the tables as we understand them in database
terms, so that all the data is linked by those fields.
Thanks again.
Ok - I think we are on the same page - but just to be sure.
Table one has a record with the value 'A1' in the ID field then. Table 2
also has a record with the value 'A1' in the ID field and so does Table 3.
You want to have a field where you select 'A1' and the 3 tables display
the appropriate record on the form ready for data to be input to the 6
fields.
Right?
In this case then yes use of sub-forms is the way to proceed.
Also, I see that there is now a 4th table involved - one that supplies
the 'master' ID, if you will. I will use the table name MASTER for this
table, and you can build your form as follows.
Use the form wizard to create the form, based on the table MASTER. In
the field selection step select only the field ID, be sure that the form
layout is using individual text controls not the table grid.
In the final step of the wizard select 'Modify the form' and click Finished.
Now with form open in edit mode insure that the tool bar 'Form Design'
is displayed.
Select the tool button 'Form Nagivator' form the 'Form Design' tool bar
- the Form Navigator window opens.
In the navigator window thee are now 4 entries:
Forms
--MainForm
----lblID ( A label control )
----fmtID ( or txtID depending on the data type of the ID field )
Now you add the sub-forms.
Click on the word MainForm in the form navigator window to select it.
Right click for the context menu and select 'New>Form'
Repeat this 2 more times.
The form navigator window now looks like:
Forms
--MainForm
----lblID
----fmtID
----Standard
----Standard 1
----Standard 2
You can select and rename those new dataform controls from standard to
Table1, Table2, Table3 is you like.
In the form navigator window still, select the dataform control Standard
- right click and select Properties.
The control properties editor is now open.
In the properties editor window select the tab 'Data'
The property 'Content Type' will be set to "Table"
In the next property 'Content' use the drop down list to select "Table1"
Four properties below this is the property 'Link Master Fields' and to
the right of this is a button with the label '...'.
Click this button next to 'Link Master Fields' and the 'Link Fields'
dialog opens.
Select the field ID in both columns of the first row of drop down boxes.
Close the 'Link Fields' dialog box, but not the property editor.
Select the dataform 'Standard 1' in the 'Form Navigator' window.
Switch back to the Property Editor window and repeat the steps above,
but for Table2.
Now repeat these steps for Table3.
Still with me?
OK - now you have a form and 3 sub forms all linked together, but no
controls for the data fields.
In the Form Navigation window select the dataform Standard again.
On the 'Form Design' tool bar click on the button 'Add Fields'
The 'Add Fields' window is now open and displays the 3 fields from Table1
Drag and drop the fields 1 & 2 from the 'Add Fields' window to the form
With the 'Add Fields' window still open select 'Standard 1' in the 'Form
Navigator' window.
The 'Add Fields' window now displays the 3 fields from Table2
Again drag and drop the 2 data fields to the form.
Repeat the process for the Table3 fields.
Close the 'Add Fields' window
*OK - now for the most important part.*
Select the dataform control 'Standard' in the 'Form Navigator' window again
Switch to the 'Property Editor' window
On the 'Data' tab again find the property 'Navigator bar' change this
from Yes to No.
REPEAT this step for the dataform controls "Standard 1" and "Standard 2"
Close the property Editor, the Form Navitgation window and the Form
Design toolbar
Save and close your form.
You are good to go.
The form will keep your 3 tables n sync with the MASTER table.
I assume that these ID fields in TABLE1..3 are actually FK's back to the
master - Yes?
Drew
--
OpenOffice.org User Community Forum: http://user.services.openoffice.org
United States PostgreSQL Association: http://www.postgresql.us/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]