View Single Post
  #2  
Old May 6th, 2005, 06:42 PM
Sprinks
external usenet poster
 
Posts: n/a
Default

Hi, Pearl.

A subform is linked to a main form by the LinkMasterFields and
LinkChildFields properties of the subform, which are the matching fields in
the main and subform's record sources, respectively. Since a main
form/subform is used to display a one-to-many-relationship (one main form
record with many subform detail records), this field is normally the primary
key of the main form record source and a corresponding foreign key in the
subform. For example:

Customer: ABC Corporation
Address: 1234 Lincoln Hwy.
etc...more main form fields

Orders:
Order # Order Date OrderStatus
--------------------------------------------------
1234 1/1/05 Closed
1356 2/3/05 30 Days Past Due
....more Order records

Notice the linking field (CustomerNumber) need not be *displayed* in either
form, but it must be a field in each of the forms' record sources.

I'm kind of surprised you'd be linking by a last name, which normally would
never be used as a primary key. I also don't understand why you would want
to display the name on the subform also; it doesn't add any new information.

Hope that helps. If you need any further discussion on the last topic,
please provide more detail about the generic purpose of your application and
its tables.

Sprinks


"Pearl" wrote:

I have a main form that has a field called LastName. I also have a subform
that also has a field called LastName. I placed that field in the subform to
be able to correlate the subform to the mainform BUT what I want is that each
time I open the form to a specific LastName in the main form that the subform
field called LastName will auto populate with the same value in the mainform
field called LastName. How do I do this? I have done this a long time ago
but can not remember how I did this. I recall I did this completely using
the Build option in properties of the field and did not use VBA ( I am not
versed in VBA and would prefer to not do this in VBA). Can anyone assist?