Solved

MS Access Need help designing a weekly user project input

Posted on 2013-05-22
5
382 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)
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks fyed!
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
Glad I could help.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

762 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

6 Experts available now in Live!

Get 1:1 Help Now