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!

Setting up a partially related/partially not table.. 1

Status
Not open for further replies.

Tarnish

Technical User
Nov 13, 2006
221
US
Hi all,

I have an app and I want to add the ability to log mail that comes into the office where the app will be used. The primary focus of the app is file management. In the past, tables that have been similar in relative position to this one would just be one-to-many relationships with the main table. For example, I can add invoices to files in my app.

In this case, I'd like to be able to relate some mail to some files, but there are DEFINITELY going to be cases where some mail just doesn't go with any particular file yet it needs to be entered into the app and appear in reports with the other mail (at least any report not specifically listing mail associated with files).

I'm assumming I should not have the file table pk as a fk in the mail table and therefore shouldn't have the tables related in the relationships window. But how else do I associate some mail with some files?

Thanks for any guidance. I know this is pretty basic but it's just the first time I remember running into this type of situation.

T
 
There is no reason why you should not have the file pk as an fk in the mail table. Just make sure that you allow nulls.
 
Thanks for the reply, Remou,

So would I still relate them in the relationships window? I'm almost sure I can't enforce ref integrity (doesn't that require no nulls in the matched up fields?)..

Thanks,
T
 
The no nulls rule is for primary keys. You can enforce referential integrity.

 
Ok, I got it. Not sure what I was thinking...

Thanks,
T
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top