Results 1 to 10 of 10
  1. #1
    ellixer is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    35

    Help w/ DB from scratch.


    I have been charged with creating a DB for patients in a recovery program. There is a lot of specific information they want to keep track of for each person in order to gather stats.

    I am a first time access user and have managed to build a database with tables and forms, but I dont know if i correctly disseminated the fields, and I cant seem to get the relationships right. Any ideas?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Best advice I can give you is pick an existing template from among those that ship with Access or are on-line at MS Office that is close to what you want. Then modify it to your specifications.

  3. #3
    ellixer is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    35
    Here is a screen shot of my relationships.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Okay, you don't want to start over. Where to start? Every table should have a PrimaryKey (PK), preferably an AutoNumber field and it should be named something that identifies the table. This key is placed in other tables as a ForeignKey (FK) which will define the relationship for Access. You seem to have put the same key in several tables as the PK unless I simply do not understand your diagram. At least the PK fields are named the same which is never a good idea.

  5. #5
    ellixer is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    35
    Ahhhh, ok got that. But how do i put the foreign key in the main tbl?

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It looks to me like your "Main" table is tblParticipants and it doen *not* need an FK. I hope you named it something useful like ParticipandID instead of DOC#. You then only need the ParticipantID in the [tblDischarged Participants] table instead of duplicating all of that data. In fact that whole table may just be a single field in the tblParticipants table named Discharged.

  7. #7
    ellixer is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    35
    Ok, thanks. It's a bit clearer now.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Reading up on Normalization should help. Google know a lot about that subject. Basically data should *only* exist in one table in an RDBMS. You can put the PK of that table anywhere you need a reference to it and a query join will make it as if the data is all in the same table.

  9. #9
    ellixer is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    35
    Yeah, ive been trying to figure out normalization, most of the examples they have are very easy basic stuff so its hard to try and put that with all the info i have.

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You goal should be Third Normal Form: http://www.phlonx.com/resources/nf3/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access Novice - Looking to learn from scratch.
    By Javaman in forum Database Design
    Replies: 1
    Last Post: 03-13-2010, 08:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums