dbTalk Databases Forums  

relations in FM 7

comp.databases.filemaker comp.databases.filemaker


Discuss relations in FM 7 in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rob
 
Posts: n/a

Default relations in FM 7 - 07-12-2004 , 11:04 AM






I have a small two-table database containing table Company and table
Contacts.

The Company table has all the address data for a given company, one
company may have one or more Contacts. The tables are linked (related)
through the Company_ID field in both tables.

Company_ID is an auto-number field and does not contain company names.

The Company table is filled with all companies I do business with.

For adding records in the Contacts table I want a dedicated Layout
having a field with a Pop-up List showing all the companies from the
Company table, as well as fields to add the record to the Contacts
table. I want to link the Contact to the Company in one layout.

I can make the Pop-up List work in Find mode but I need to make it work
in Browse mode to add Records... :-(

In other words: the first field in the Layout is supposed to make the
link to the Company table and from field #2 I am adding data to a new
record in the Contacts table. After selecting ABC Inc. from the pop-up
list I add John as a new contact (working for ABC Inc.).

Can anyone give me some directions - please????

Thanks - Rob

Reply With Quote
  #2  
Old   
Matthew Smith
 
Posts: n/a

Default Re: relations in FM 7 - 07-12-2004 , 07:50 PM






In article <10f5dkbkc38st6c (AT) corp (DOT) supernews.com>,
Rob <krekmek (AT) hotmail (DOT) com> wrote:

Quote:
I have a small two-table database containing table Company and table
Contacts.

The Company table has all the address data for a given company, one
company may have one or more Contacts. The tables are linked (related)
through the Company_ID field in both tables.

Company_ID is an auto-number field and does not contain company names.

The Company table is filled with all companies I do business with.

For adding records in the Contacts table I want a dedicated Layout
having a field with a Pop-up List showing all the companies from the
Company table, as well as fields to add the record to the Contacts
table. I want to link the Contact to the Company in one layout.

I can make the Pop-up List work in Find mode but I need to make it work
in Browse mode to add Records... :-(

In other words: the first field in the Layout is supposed to make the
link to the Company table and from field #2 I am adding data to a new
record in the Contacts table. After selecting ABC Inc. from the pop-up
list I add John as a new contact (working for ABC Inc.).

Can anyone give me some directions - please????
Make sure the layout where you are adding contacts is working with the
Contacts table. While in Layout mode, select Layout Setup from the
Layout menu. The "Show Records From" should be your Contacts table.

Your value list for the companies should have the first field as the
Company_ID and the second field as the company name, sorting on company
name.

On your layout make the first field be the Company_ID in the Contacts
table. Attach the value list to this field. Create a second field that
is exactly the same size and place it over the Company_ID field. Make
this field the company name in the Company table. Make the field not
enterable (in Field Behavior).

Add the rest of the fields for the contact.

When you want to create a new contact, go to this layout and create a
new record. You should now be able to assign a company id to the record.

To make the value list look tidy, either start the company id number
from a large number, like 10001, or prefixed with a letter, eg. C000001.

You could also have a portal of all the contacts for the company on a
company layout. It is also possible to have a button on the company
layout that will go to the contact layout, create a new field and
prepopulate the company id field with the one from the company layout
where you clicked the button.


Reply With Quote
  #3  
Old   
Rob
 
Posts: n/a

Default Re: relations in FM 7 - 07-13-2004 , 09:17 AM



Matthew Smith wrote:

Quote:
In article <10f5dkbkc38st6c (AT) corp (DOT) supernews.com>,
Rob <krekmek (AT) hotmail (DOT) com> wrote:


SNIP


Make sure the layout where you are adding contacts is working with the
Contacts table. While in Layout mode, select Layout Setup from the
Layout menu. The "Show Records From" should be your Contacts table.

Your value list for the companies should have the first field as the
Company_ID and the second field as the company name, sorting on company
name.

On your layout make the first field be the Company_ID in the Contacts
table. Attach the value list to this field. Create a second field that
is exactly the same size and place it over the Company_ID field. Make
this field the company name in the Company table. Make the field not
enterable (in Field Behavior).

Add the rest of the fields for the contact.

When you want to create a new contact, go to this layout and create a
new record. You should now be able to assign a company id to the record.

To make the value list look tidy, either start the company id number
from a large number, like 10001, or prefixed with a letter, eg. C000001.

You could also have a portal of all the contacts for the company on a
company layout. It is also possible to have a button on the company
layout that will go to the contact layout, create a new field and
prepopulate the company id field with the one from the company layout
where you clicked the button.
Matthew - you're the hero of the day. Took me some re-reading to make it
work (too impatient) but this is what I meant.

BTW I used 0001 to start the Company_ID numbering and that works too
(0001, 0002, 0003 ..., 000n).

Thanks - Rob


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.