Hot Topic (More than 10 Replies) Setting Up SubForm (Read 1660 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Setting Up SubForm
Apr 13th, 2004 at 2:06pm
Print Post Print Post  
When we setup subform with Relational Link, Step 4 ask for -

Subrecord Field Name:
Parent Record Field:
Child Record Field:

What does Subrecord Field Name Stands for and where and how it is used and where it is referenced in the subsequent procedures or programming?  If we have two subforms of the same layout, one in tableview and other in formview, will that have the same Subrecord Field Name or different Subrecord Field Name?
  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Setting Up SubForm
Reply #1 - Apr 13th, 2004 at 3:08pm
Print Post Print Post  
As far as I can tell, it is just a way to identify the subform when you are in Manage Fields of the parent database.

If you want two subforms of the same layout, you probably want to select "Show existing Natural Child records...". And if you do that, the Subrecord Field Name is already filled in with the same name as your first subform for the same layout.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Setting Up SubForm
Reply #2 - Apr 13th, 2004 at 6:40pm
Print Post Print Post  
Carl, thanks. I got it.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Setting Up SubForm
Reply #3 - Apr 14th, 2004 at 12:35pm
Print Post Print Post  
The Subrecord field name is extremely important. A field of type SUBRECORD contains all the information regarding which records you want to link and how. The field knows:
1. Whether the link is natural or relational
2. If relational, which values are supposed to match
3. Which database contains the subrecords

When you select Show Existing .., you are telling Sesame to show the exact same records already defined by an existing SUBRECORD field. This allows you to do some neat tricks. For example, say you run a hospital network. You can create a generic Contacts database, with an Contact Form that has elements for Name, Address, Phone, etc. You can then create a Hospitals database and Form. On your Hospital form, you can put a naturally linked Contact subform bound to a field called Doctors. You can put on your Hospital form another naturally linked Contact subform bound to a different field called Nurses.

Both subforms will display the Contact Form. If you change the Contact Form, both subforms will show the change. As long as you are looking at the Hospital form, Doctors and Nurses will never get mixed together. However, if you open the Contacts form standalone, you can get a list of all the Hospital employees, regardless of whether they are Doctors or Nurses.

Basically, each Subrecord field name represents a particular batch of a particular kind of record.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Setting Up SubForm
Reply #4 - Apr 14th, 2004 at 12:50pm
Print Post Print Post  
Thanks Erika. This makes it clear about its importance and purpose.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Setting Up SubForm
Reply #5 - Apr 14th, 2004 at 1:46pm
Print Post Print Post  
Quote:
On your Hospital form, you can put a naturally linked Contact subform bound to a field called Doctors. You can put on your Hospital form another naturally linked Contact subform bound to a different field called Nurses.



How do you bind the Subform to a field in Natural Link? When you make a Subform, the element bound to selection let you select only Unbound and all other choices blank out. In the Subform Setup, if I choose Natural Automatic Link, it just let me put the Subrecord field name for the pupose of displaying it in the Manage Database. If I change Bound To using Propery Editor, it does not reflect the change in Property Viewer.  ??? Obviously I am missing something.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Setting Up SubForm
Reply #6 - Apr 14th, 2004 at 1:59pm
Print Post Print Post  
When you enter the field name in the Subform Properties, you "bind" the subform element to that field.  To change it, delete the subform LE and create a new one, selecting the desired subform properties.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Setting Up SubForm
Reply #7 - Apr 14th, 2004 at 2:23pm
Print Post Print Post  
I think I am really dense.  I am still not getting it. When I make a new subform, Step 4 - Set Subform Property, I cannot choose Parent or Child Record Field if I choose Automatic Natural link. Only choice one can make is subrecord field name that has to be unique and it is used in order to display the subform element as field in the manage database module. (So far I have worked with only relationally linked subforms) In Relationally linked field only it let me choose the field name.  I am still not clear, how do I choose the field name of the main form to which the subform to be bound in order to have subform having Automatic Naturally Linked. Erika, please bear with me, I really feel that I am missing something basic here that I should have known better.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Setting Up SubForm
Reply #8 - Apr 14th, 2004 at 2:52pm
Print Post Print Post  
On a Natural Link, the Parent and Child choices will be disabled. Natural Linking does not use value matching, so these choices do not apply.

To create a new Natural Link, choose "Make Natural Child Records" from the dropdown in Step 3. Enter a new field name in Step 4.

To use an existing Natural Link, select "Show Existing Natural Child Records" in Step 3. The field name in Step 4 will be filled in automatically.

If you hover your mouse over the Step 3 dropdown, the tooltip may provide some useful information.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Setting Up SubForm
Reply #9 - Apr 14th, 2004 at 7:08pm
Print Post Print Post  
Erika,
I got it now. I thoght that the subform can be linked  to an element of the mainform (as opposed to "bound" to the field of database). I guess there is no other alternative but to go to relational link to achieve that. However, automatic link is also interesting. Thanks.
  
Back to top
 
IP Logged
 
JJuarez
Member
*
Offline


No personal text

Posts: 26
Joined: Dec 15th, 2003
Re: Setting Up SubForm
Reply #10 - May 28th, 2004 at 4:49pm
Print Post Print Post  
I am just now trying this setting up subforms.  I have printed out the previous messages and have tried to follow and understand how to setup subforms.

I can't seem to get my links to work  Cry

I have my family database and am trying to now set it up with tabs to show family member then show in tabs the children, grandchildren, greatgrandchildren....etc

More help on this or a sample program to download to be able to follow sure would be nice  Grin

Thanks
  
Back to top
 
IP Logged
 
Justin_ICC
Junior Member
**
Offline



Posts: 95
Joined: Feb 5th, 2004
Re: Setting Up SubForm
Reply #11 - May 28th, 2004 at 5:43pm
Print Post Print Post  
Quote:
I have my family database and am trying to now set it up with tabs to show family member then show in tabs the children, grandchildren, greatgrandchildren....etc


I have done a fair bit of work with tabs and subforms for sesame - the first problem that I can see is that you want it to iterate an infinite number of family members until it runs out of generations. To do this each subform will be smaller than the previous subform unless you want to use scroll bars.

The first thing you need to ask is how many generations do you want to show simultaneously? (on a single form).

There are 2 ways of linking the information.

How are you deciding that there is a common parent? Are you wanting to enter the children from the parents screen etc?

One good way to handle linking parents to children is to create a unique identifier for each person and use this as a method of referring one to the other - that way if you change someones name it doesn't break the link if you're using relation links based on name.

With a little more information I can probably help you through this problem.

I would also suggest starting a new topic for this as its related but not related - it will make your topic easier to find & get responses.

I hope this helps,

Justin
  
Back to top
 
IP Logged