Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / February 2008

Tip: Looking for answers? Try searching our database.

Multi-Field Primary Key

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
E.Q. - 07 Feb 2008 02:59 GMT
A bit of background:
I configured a database for goals and objectives for my personal use to
generate a required monthly activity report that my boss requested.  It has
the following structure:
tblGoalComp
-lngGCID (PK)
-chrGoalName
-....

tblObjective
-lngObjID (PK)
-lngGCID (FK)
- chrObjName
- ...

tblGoalLog
-lngLogID (PK)
-lngObjID (FK)
-dtmEventDate
-chrEventDescrip

I've use it for a year and my boss likes it. He has asked me to expand this
for my fellow supervisors.  For now I'm going to cheat and give them all a
blank copy of the database I use. (They're going to be facing a March 10
deadline to start using it.)  But I know that really limits what might be
done with the database.  So I'd like to expand.

I've taken a copy of the database and added a table (imported from another
project) with employee data, tblEmployee. I've then created a table to assign
the goals to the supervisors,tblGoalAssign, to deal with a many-to-many
relationship.
Though I've managed to avoid multi-field primary keys in any effort so far,
I believe I ran into a use for one here . So I have
tblGoalAssign
-chrEmpID (from tblEmployee - chr to allow leading zeros)
-lngGCID (From tblGoalComp)
-intYear

These three fields uniquely identify each record, so I made them a multiple
field primary key.  My problems is in relating these fields "downstream" to a
table that performs like tblGoalLog in the original database.
I want to make sure that the reports generated reflect the activity of the
individual supervisors. So the tracking log needs to reference the goal
assignment. But  I don't have anything to link to (since none of the three
fields individually identify a record in tblGoalAssign).  Do I need to add an
"Autonumber" field to tblGoalAssign to provide such a linking? Would that key
then be a forth field in the primary key? Or is there a better way to address
tracking work activities associated with the assigned goal.
Peace.
EQC
E.Q. - 07 Feb 2008 22:41 GMT
I did a search on the "General Questions" Access and found a reference to
creating a multiple-field index.  That would solve the problem of maintaining
unique records for the three fields (which I'll join in a single index); then
I'll create an autonumber primary key to link to the tracking log.
I think this should solve the issue; but if anyone has any more tips for me
(other than scanning the general questions before posting here), I'd welcome
any advice.
Peace.
EQC
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.