Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assistance with table relationships -- data not correct

Status
Not open for further replies.

ccmandel

Technical User
Aug 2, 2005
6
US
I must have something wrong with the relationship between my tables or else with the primary key. I have two tables . one that has information on properties (propertyname, address, phone, email,l etc.) the second table has information on contacts relating to that property (name, position, email).

Proeprty Table
-PropertyID
-PropertyName
-Address
-etc.

Contact Table
-PropertyID
-Name
-Position
-Email
---------

I have an autonumber field (propertyID) as the primary key in the Property Table, related to the PropertyID in the Contact table. On the form , the properties are listed and I have a subform (contacts). The contacts relating to the specific property are shown. This works fine.

however, when I open the subform . I expected the propertyID from the Property table to carry over for each contact in the contact subform (from the table) . This isn't happening.

I expected the tables to link properly. As each new contact is created . I expected it to link up to the appropriate property name.

How do I do this so that the data is valid? I assume that the relationship is one-many . and referential integrity is checked .

HELP!



 
Double check the LinkMasterFields and LinkChildFields properties of the subform control.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I have those filled in

LinkMasterField: PropertyID
LinkChildFields: PropertyID

When I look at the Contact Table . shouldn't the PropertyID's from the related tables be filled in? if not, how do I accomplish this?

 
Hi ccmandel,
First of all, your TableNames are set up a bit funny which can give problems. I would suggest:

Property Table
- PropertyID
- PropertyName
- PropertyAddress
-etc.

Contact Table
- ContactID
- PropertyID
- ContactName
- ContactPosition
- ContactEmail

set the relationship between the two tables in the relation manager. If propertyID in tblContact can have duplicates, it will set a 1-m relationship.



Pampers.

You're never too young to learn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top