Forums
This topic is locked
Very complicated
Posted 17 Feb 2003 15:52:22
1
has voted
17 Feb 2003 15:52:22 Tony Chronopoulos posted:
I will try to be descriptive.I have the following MS Access tables:
tbl_projects
~~~~~~~~~~~~
project_id (autonumber)
project_name (text)
project_type (number)(1 = single | 2 = group)
project_owner (number)
tbl_timesheet
~~~~~~~~~~~~~
ts_id (autonumber)
ts_date (date/time)
ts_projectID (linked to tbl_projects.project_id)
ts_workDesc (number)
tbl_groups
~~~~~~~~~~
group_id (autonumber)
group_owner (number)
tbl_groupMembers
~~~~~~~~~~~~~~~~
gmember_id (autonumber)
gmember_groupID (number) (linked to tbl_groups.group_id)
gmember_userID (number)
tbl_users
~~~~~~~~~
user_id (autonumber)
user_username (text)
user_password (text)
user_secLevel (number) (1=Admin | 2=Manager | 3=reg. user)
----------------------------------------
Mike (who is a regular user) can only create Projects with a type=1 (single). If Mike creates a single Project, then only Mike exclusively owns that project and his userID (15) should be stored in tbl_projects.project_owner.
Only an Admin or manager can create a group. So then, let's say Peter, who is a manager, creates a project with a type = 2 (group) and his userID is stored in tbl_projects.project_owner. He then creates a group and adds Mike (userID=15), Lisa (userID=20) and Frank (userID=231) as members to the group.
I'd like to display all of Mike's projects including Single and Group projects. It's easy to display the single projects because Mike's ID is stored directly in project_owner.
But for group projects, the group owner's id is stored in project_owner and Mike's ID is stored in the groupMembers table.
I can't figure out how to display group projects that users belong to. I don't know if you understand what I'm trying to do..
Thanks for any help..
___________________
microdesign² | www.microdesign2.com