Results 1 to 11 of 11
  1. #1
    Nokia N93 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    55

    Unhappy how to connect Activites table with workers table?

    I have a project with several activities, each activity has specific people who work in the activity and of course an ID for the activity.


    Now every person has a unique ID, name, address, birth date, address ,,,, etc

    a person can work in several activities ,, now what i want to know is should i put activities in a table , and persons in another table or what !!? how can i connect the two tables? How can assign a new activity for the persons?

    let us say that all the activities need 100 workers, but there will be duplicate of the workers, how can i find the actual number of the workers without duplicate?? ( i need to find the numbers of all workers and the number of the actual workers)

    Finally i want a restriction that if a person worked in five activities, i want an alarm or warning that this person has worked for four activities and he can't work any more, is that something i can do !??

    thanks a lot for your time and concern

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    You need to read up on database normalization.
    Here is a link to a design article which may help you. It has links to various topics also.

    http://forums.aspfree.com/attachment...2&d=1201055452
    Another topic of interest to you will be Junction Tables.

    Good luck with your project

  3. #3
    Nokia N93 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    55
    attached is a sample Db for my initial work, i can't figure out how to make a form for inserting the data
    what i really want is to attach the activity with the persons, plz help me


    Project.accdb

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848

  5. #5
    Nokia N93 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    55
    thank you orange
    i saved it as 2003 , it is very simple oneProject.mdb

  6. #6
    Nokia N93 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    55
    Quote Originally Posted by orange View Post
    I have acc2003 and can not use accdb formatted file.

    See http://www.youtube.com/watch?v=7XstSSyG8fw
    thankx for the link too, that what i ilready did
    my question how to link the persons to the activiteis, is it by using forms ???

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    I have modified your table tblPersonActivites slightly. I have added a Unique index called UniqueIndex_1.
    It includes both
    PersonId and ActivityId.
    This is done to prevent assigning the same Person to the same task (prevent duplicate assignments).
    You can see the index by clicking on the "lightning bolt symbol" on the table design menu beside the Key for PK assignment.
    I have added a form to your database Form_AssignPersonsToActivities.
    The form has 2 combo boxes and a button.
    There is code behind the ButtonClick event to insert records into your tblPersonActivities table.

    Look at the SQL behind the button click event.

    Post back if there are questions.

    Good luck with your project.
    Attached Files Attached Files

  8. #8
    Nokia N93 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    55
    thank you alot
    but is this the only way to insert the data?? i mean when i have one hundred persons or more, will it be easy to assign the activities for them ??

    Another thing i want a warning or a message to appear when a person worked in five activities, the warning tell me that this person has worked in five activities and he can't work any more

    pardon me Orange, i know that i ask too many sorry for that


  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Do you really only want 5 activities max per person??? Shouldn't that include some sort of time frame???
    Only 5 activities in one week, or 1 month ????
    What I showed was a typically way of doing People-Task assignments--- does it not work for you?

    If you Enter the first char of the lastname , the combo should show persons with that char.

    Do you have another method in mind?

  10. #10
    Nokia N93 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2010
    Posts
    55
    Quote Originally Posted by orange View Post
    Do you really only want 5 activities max per person??? Shouldn't that include some sort of time frame???
    Only 5 activities in one week, or 1 month ????
    What I showed was a typically way of doing People-Task assignments--- does it not work for you?

    If you Enter the first char of the lastname , the combo should show persons with that char.

    Do you have another method in mind?
    Sorry for the delay in replying
    thanks alot for the help and the file, it really helped me
    i really appreciate your help

  11. #11
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848

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

Similar Threads

  1. Replies: 1
    Last Post: 10-02-2012, 07:31 PM
  2. How I can connect access table in browser
    By learning_graccess in forum Programming
    Replies: 1
    Last Post: 04-04-2012, 04:40 PM
  3. CALENDAR on form wont connect to TABLE
    By taimysho0 in forum Programming
    Replies: 6
    Last Post: 01-13-2012, 10:23 PM
  4. Replies: 0
    Last Post: 03-28-2011, 11:05 AM
  5. Connect Foxpro table in access
    By genny in forum Import/Export Data
    Replies: 6
    Last Post: 11-08-2010, 02:31 AM

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