Timesheet & submitting to Access DB - InfoPath Dev
in

InfoPath Dev

Timesheet & submitting to Access DB

Last post 04-29-2007 10:48 AM by Grazzers. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 04-12-2007 02:23 AM

    • Grazzers
    • Not Ranked
    • Joined on 04-12-2007
    • United Kingdom
    • Posts 13

    Timesheet & submitting to Access DB

    Hi.

    I'm a new user to Infopath (2003) and currently use an excel sheet to gather and consolidate timesheet information from around 150 users - extremely time consuming! What I would like is to have users complete a timesheet in Infopath and have them submit the data straight to Access (something I'm sure Infopath could do with its eyes shut)! . My problems are two fold:-
    1) I want users to input their name, staff id and week just once at the beginning of the form and their activites for the week underneath. I have created a repeated section for name/staff id and a repeating table for activities. However when I click on Submit all the activities feed Access but the name/staff id only appears against the first activity. How can I get the name/staff id to be added to all activities within Access?
    2) Users input the actual time they spent on an activity (10 mins, 1hr etc) rather than show From and To. I can get round this by formatting to "Time" and "No date" but is there a way of adding these together on the form to show the total time spent? Unfortunately I have no knowledge of code and I'm guessing this may be the only way to do it...

    Any help would be most appreciated
  • 04-13-2007 08:09 AM In reply to

    Re: Timesheet & submitting to Access DB

    For your item #1: You should create a field in each repeated section. (a nique identifier like SSN) Then make the field filled in automatically & hide the field. (SSN_1, SSN_2 = which has same value as SSN) When you import the data into MS Access, create a relationship using the unique identifier. Then write your report or query.

    For your itme #2: Are you trying to add it for each day or by pay period based on certain activity (i.e., activity costing?)
  • 04-14-2007 01:48 PM In reply to

    Re: Timesheet & submitting to Access DB

    Hi Grazzers, and welcome to the InfoPath Dev forums!

    For #2 have you looked at the functions available in InfoPath? Unless I am not understanding what you want to do, you have a repeating field that tracks the amount of time spent on an activity. You can use the xpath sum function to total the time in that field. You don't need any code to do this, it can be done all within the functions available in InfoPath
  • 04-20-2007 12:56 AM In reply to

    • Grazzers
    • Not Ranked
    • Joined on 04-12-2007
    • United Kingdom
    • Posts 13

    Re: Timesheet & submitting to Access DB

    Thanks for the reply.  Users will input the time spent on an activity on a daily basis e.g. Mon - 1 hr 40 minutes, and I have formatted the Text Box as a Date/Time (not showing date but showing time as 1:40).  If, after two days of inputting 1:40, how do I show the total as 3:20?  One way round this would be to ask users to input the time in minutes however I don't want to ask them to do this as working out 6 hrs 42 minutes can get a little tricky. I also don't want users to input 1.4 as adding this together gives 2.8 and I want it to say 3.2

     Hope his makes sense. Thanks in anticipation

  • 04-20-2007 07:37 AM In reply to

    • ahardin
    • Top 200 Contributor
    • Joined on 02-13-2006
    • United Kingdom
    • Posts 55

    Re: Timesheet & submitting to Access DB

    Hi

    First off you need two tables in Access, one for name, staff id, week and total, and the other activity, time and staff IDs

     Set up a relationship in Access and Infopath where for each 1 staff id there can be many staff IDs, ie a one-to-many relationship.  Then,

    1) there is no need to have this data in a repeating section you can just have it on the form once.  In answer to your question the one-to-many relationship you setup will ensure that the data is input correctly into the database.

    2) To keep it simple make them only enter the time in minutes, then right-click the repeating table and then 'Display' and tick 'footer'.  Add the field "total" in the footer.  Go into the "total" field and click the fx button.  Click 'Insert Button' and select "Sum" click OK.  double click the 'double click to insert field' and select the "time" field.

    Job done, i hope.

    Adam

    I'm from WALES
    [email protected]
  • 04-20-2007 07:41 AM In reply to

    • ahardin
    • Top 200 Contributor
    • Joined on 02-13-2006
    • United Kingdom
    • Posts 55

    Re: Timesheet & submitting to Access DB

    OK

    as per my previous post restrict it to just minutes OR separate out the hours and minutes into two separate fields and format the sum on the minutes column to be dvided by 60 on a rule and then add each whole number as an hour into the hour box.  Quite complicated

    I'm from WALES
    [email protected]
  • 04-29-2007 10:48 AM In reply to

    • Grazzers
    • Not Ranked
    • Joined on 04-12-2007
    • United Kingdom
    • Posts 13

    Re: Timesheet & submitting to Access DB

    Thanks for the advice.  As you say it seems that I need to create a box for hours and a box for minutes.  Not the most ideal but I don't see any alternative. 

    Thanks again

Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.