Solved

MS Access Need help designing a weekly user project input

Posted on 2013-05-22
5
389 Views
Last Modified: 2013-05-30
I have a Access database of projects with users assigned to them, and would like the users to input what projects there working every week.

The goal is for the manager to view what the users are currently working on (current week), and to provide a report for how many weeks the user worked on that project.

How should the user input this information?  Table structure?
(date range wouldn't work due to the project is not worked on consecutively)
0
Comment
Question by:DJPr0
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 39188847
Depends on how detailed you want it.  Do you want the user to simply check a checkbox to indicate that they worked on a particular project during a particular week, or do you want them to indicate how many hours they worked each day on the project (similar to a time-card application)?

Are they going to do this at the beginning of the week so that manager knows what they "plan" on working on, or daily, or at the end of the week, to know what they "actually" worked on?

Table structure of tbl_Person_Project_Effort might look like:

Person_ID
Project_ID
Period (date/time) - could be the first day of the week, or every day of the week
Effort : this could be a Yes/No or more likely a single datatype to record hours.

Each week, I would load this table with the combinations of Person, Project, and Period (either a single day or all 5 days of the week).  How you present that data to the user to enter data would depend on whether your period is a weekly (on day) or a daily (multiple days) effort.
0
 

Author Comment

by:DJPr0
ID: 39190699
Do you want the user to simply check a checkbox to indicate that they worked on a particular project during a particular week,
 Yes

Are they going to do this at the beginning of the week so that manager knows what they "plan" on working on
  Yes

How you present that data to the user to enter data would depend on whether your period is a weekly (on day)
  Yes, weekly is desired.

Each week, I would load this table with the combinations of Person, Project, and Period (either a single day or all 5 days of the week).

How could I set up a period for every week?
Which day of the week doesn't matter - we would like the user to select on Monday and make modifications any day of the week, of what projects the user is working on a given week.
0
 
LVL 48

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 39191029
As I indicated, I would probably have a table with the fields indicated above.

Whenever your form is opened, I would check to see whether the current weeks date (probably Sunday or Monday) has been entered into that table.  If not, I would use an Insert query to insert the current week into the table for each person that is still working on the product.

Dim dtDate as date
Dim strSQL as string

dtDate = format(Date() - Weekday(Date()) + 1
if DCOUNT("Person_ID", " tbl_Person_Project_Effort", "[Period] = #" & dtDate & "#") = 0 Then

    strSQL = "INSERT INTO  tbl_Person_Project_Effort (Person_ID, Project_ID, Period, Effort) " _
                & "SELECT DISTINCT Person_ID, Project_ID, #" & dtDate & "#, 0 " _
                & "FROM  tbl_Person_Project_Effort"
    currentdb.execute strsql, dbfailonerror

End If

I would probably rework that SELECT portion of the Insert statement, because we would not want to include projects that have been closed out in that mix and the way it is written, it would capture all of the projects each person has ever worked on.

By doing this test every time the form is opened, you would ensure that the first person that uses the form each week would actually add all of the person/project records for everyone.

Then, what I would do is make the form where you want the user to enter the data either a continuous form (with combo boxes in the header) or a form/subform structure with combo boxes on the main form.  The two combo boxes would be to select the person, and the week.  

I would set the Person combo so that when the user opens the form, the CURRENT event fills in that combo with the current users Person_ID.  If that person is not a manager, I would prevent them from changing that to another persons ID.

I would set the Period combo box to display all of the available periods:

SELECT DISTINCT [Period] FROM tbl_Person_Project_Effort ORDER BY [Period] DESC

and would then set the value of that combo box to the current week (see dtDate above)

The recordset for the form (assuming continuous form format) would look something like:

SELECT Project_Name, Effort
FROM tbl_Person_Project_Effort
INNER JOIN tbl_Projects ON tbl_Person_Project_Effort.Project_ID = tbl_Projects_ID
WHERE tbl_Person_Project_Effort.Person_ID = Forms!yourFormName.cboPersonID
AND tbl_Person_Project_Effort.Period = cdate(Forms!yourFormName.cboPeriod)
ORDER BY tbl_Projects.Project_Start_Date

In the AfterUpdate event of each of those combo boxes, I would requery to form, to ensure that the current person/period are selected.
0
 

Author Closing Comment

by:DJPr0
ID: 39207613
Thanks fyed!
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 39209727
Glad I could help.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question