A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

two keys for a child of a child table?



 
 
Thread Tools Display Modes
  #1  
Old March 14th, 2005, 02:46 AM
lou zion
external usenet poster
 
Posts: n/a
Default two keys for a child of a child table?

hi,

can somebody tell me what's wrong here? these tables represent pretty much
the structure i'm trying to get, but details are different. my tblLines
here lists the characters for every script, not just the one that matches
it's scriptname.

Table: tblScript tblCharacters tblLines
--------- ------------- ---------
Fields:key: Name -----oo ScriptName -----ScriptName ::note two fields
for primary key
................. Director...............key: CharID-----CharID
..................Producer.............Character.. ..............Line

the idea here is i have lots of scripts, but they don't depend on anything
so that table is the parent, effectively. for each script i have lots of
characters, and each character has lots of lines.

so, i enter a script, then it's characters and then go enter lines one by
one.

if i just go to datasheet mode in the tblLines, choose a script, i'm getting
characters for every script, and the the number of times each script appears
matches the number of characters in the script.

is there a better way to set this up in my design so in my datasheet of
tblLines it only lists the characters for the script i've chosen?

i don't know if this makes a difference in the design, but lines will be
entered as they occur in a script, not for a single character, then another
character, but rather char A, char B, Char A, Char C, etc.

thanks a ton in advance!

lou




  #2  
Old March 14th, 2005, 01:45 PM
Jeff Boyce
external usenet poster
 
Posts: n/a
Default

Lou

If you use ScriptID and CharacterID as a two-field primary key for your
tblLine, you can only have one record (i.e., Line) per Script/Character.

By the way, the word "Name" (?your primary key field name for Script) is a
reserved word for Access. Using this as a fieldname will only confuse both
you and Access -- try ScriptName or some other more description title.

It sounds like you are working directly in the tables -- this is not a good
idea for data entry. Access tables store data (in a
not-known-to-most-humans arrangement), where forms display data. Use forms
instead.

And back to the structure ... if you want/need a sequence order to lines,
you need to include a sequence order field.

--
Good luck

Jeff Boyce
Access MVP

"lou zion" wrote in message
...
hi,

can somebody tell me what's wrong here? these tables represent pretty much
the structure i'm trying to get, but details are different. my tblLines
here lists the characters for every script, not just the one that matches
it's scriptname.

Table: tblScript tblCharacters tblLines
--------- ------------- ---------
Fields:key: Name -----oo ScriptName -----ScriptName ::note two fields
for primary key
................ Director...............key: CharID-----CharID
.................Producer.............Character... .............Line

the idea here is i have lots of scripts, but they don't depend on anything
so that table is the parent, effectively. for each script i have lots of
characters, and each character has lots of lines.

so, i enter a script, then it's characters and then go enter lines one by
one.

if i just go to datasheet mode in the tblLines, choose a script, i'm

getting
characters for every script, and the the number of times each script

appears
matches the number of characters in the script.

is there a better way to set this up in my design so in my datasheet of
tblLines it only lists the characters for the script i've chosen?

i don't know if this makes a difference in the design, but lines will be
entered as they occur in a script, not for a single character, then

another
character, but rather char A, char B, Char A, Char C, etc.

thanks a ton in advance!

lou





 




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 Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Seeking some expert advice. HD87glide Using Forms 14 March 23rd, 2005 10:11 PM
unable to repair inobox Sudheer Mumbai General Discussion 1 February 20th, 2005 11:55 AM
Here's a shocker Mike Labosh General Discussion 2 October 26th, 2004 05:04 PM
Table Wizard Does Not Set Relationship if Foreign Key and Primary Key Name Do Not Match Exactly in Case. HDW Database Design 3 October 16th, 2004 03:42 AM
Semicolon delimited text query help Al Guerra Running & Setting Up Queries 3 August 12th, 2004 11:50 AM


All times are GMT +1. The time now is 12:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.