Solved

MS Access Need help designing a weekly user project input

Posted on 2013-05-22
5
383 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
  • 3
  • 2
5 Comments
 
LVL 47

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 47

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 47

Expert Comment

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

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

895 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now