10-08-2017, 09:22 PM
|
#1
|
Newly Registered User
Join Date: Oct 2017
Posts: 87
Thanks: 24
Thanked 2 Times in 2 Posts
|
Timesheet
Finally! with all your help, i am able to build a piece of it.
Would you mind taking a peak of it? for improvements?
for a better world?
PS:
Issues i still can't resolve: - I want to set the focus to txtMon1 after i click on date picker of txtStart
- How to elegantly minimise the code in cmdSubmit button - Using Loop
- How to elegantly calculate all the fields using, modules? anything that minimise coding
- Should we use SQL Strings?
- What recordset to use properly or professionaly? DAO etc..
Thank you guys!
|
|
|
10-09-2017, 05:08 AM
|
#2
|
AWF VIP
Join Date: May 2011
Posts: 8,551
Thanks: 10
Thanked 2,050 Times in 2,008 Posts
|
Re: Timesheet
tbl1Timesheet isn't properly structured.
~When you start storing specific values in field names its time for different set up. Same with numbering field names.
~you aren't using the primary key (ID) from tbl1Employees properly--or at all. It is to be the foreign key in tbl1Timesheets not EmpNo.
~don't name every primary key 'ID', prefix it with relation to the table it is in otherwise you will end up with a ton of ID fields when you run queries and not know which one you are working with.
tblTimeSheet should be structured like so:
ts_ID, autonumber, primary key
ID_employee, number, links to tbl1Employees.ID
WorkDate, date, will hold date the work was done on
WorkAmount, number will hold the value that is worked
That's it, just 4 fields. Then, when you want to put 2 weeks of work in for an employee you would submit 14 records, not 1 record with 14 fields of data.
|
|
|
The Following 2 Users Say Thank You to plog For This Useful Post:
|
|
10-09-2017, 05:38 AM
|
#3
|
Newly Registered User
Join Date: Jan 2013
Location: Massachusetts
Posts: 590
Thanks: 0
Thanked 186 Times in 175 Posts
|
Re: Timesheet
what Plog said and I would also consider a field "PayType" and have a lookup table with Pay Types such as Regular Pay, Vacation Pay, Sick Time, etc. This would enable dealing with those types of variables.
|
|
|
The Following User Says Thank You to moke123 For This Useful Post:
|
|
10-09-2017, 03:00 PM
|
#4
|
Newly Registered User
Join Date: Oct 2017
Posts: 87
Thanks: 24
Thanked 2 Times in 2 Posts
|
Re: Timesheet
@Plog: I don't understand this
Quote:
That's it, just 4 fields. Then, when you want to put 2 weeks of work in for an employee you would submit 14 records, not 1 record with 14 fields of data.
|
|
|
|
The Following User Says Thank You to jmq For This Useful Post:
|
|
10-09-2017, 03:12 PM
|
#5
|
Nifty Access Guy
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 9,046
Thanks: 307
Thanked 704 Times in 670 Posts
|
Re: Timesheet
Quote:
Originally Posted by jmq
@Plog: I don't understand this
|
What plog is saying is that you have a design issues. In other words, the way you have constructed your database will lead you to serious problems if you carry on.
Please see my blog for more information. There is text, pictures and videos explaining in detail the issue and the solution...
Excel in Access
__________________
Tony Hine - My Aspiration --- Finding a better way of Explaining ---
From this YouTube:-
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
|
The Following 2 Users Say Thank You to Uncle Gizmo For This Useful Post:
|
|
10-10-2017, 04:36 AM
|
#6
|
AWF VIP
Join Date: May 2011
Posts: 8,551
Thanks: 10
Thanked 2,050 Times in 2,008 Posts
|
Re: Timesheet
Tables should accomodate data vertically (with rows) not horizontally (with columns). tblTimesheet has too many column. Currently, 1 record in tblTimesheet equals 14 days of data.
The correct way the table should be set up is so that 1 record equals 1 day. So when you want to put in 14 days of data you don't add one record like you are now, but instead you add 14 records.
|
|
|
The Following 2 Users Say Thank You to plog For This Useful Post:
|
|
10-10-2017, 02:27 PM
|
#7
|
Newly Registered User
Join Date: Oct 2017
Posts: 87
Thanks: 24
Thanked 2 Times in 2 Posts
|
Re: Timesheet
@plog:
now i understand this.
Quote:
ts_ID, autonumber, primary key
ID_employee, number, links to tbl1Employees.ID
WorkDate, date, will hold date the work was done on
WorkAmount, number will hold the value that is worked
|
|
|
|
Thread Tools |
|
Display Modes |
Rate This Thread |
Linear Mode
|
|
All times are GMT -8. The time now is 04:32 AM.
|
|