Results 1 to 2 of 2
  1. #1
    jalal is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2012
    Posts
    17

    Reporting Time fixed as a daily variable

    Hi
    The previous problem stands solved i.e. ReportTime field shows 9:50 always.
    But it has created another problem as under

    The Formula for ReportTime : Format(Date(),"m/d/yyyy") & " 9:50:00 AM"

    The formula for ReportedAt then becomes as ReportedAt: Format(Now(),"hh-nn ampm")

    And the next step LateByMinuts:=IIf([StatusID]=1,DateDiff("n",[ReportTime],[ReportedAt]),0)

    Where stutusID is 1. Present, 2. AbsentExcused. 3. LeavePrivelege etc. is correct for the first time.


    That is when at the first time the Reported time (system time) is recorded it works fantastically but when next time the Form is opened the saved "LateBYMinuts" field is changed with the system date thus disparaging the previous save data.

    Where could be the problem
    Please help
    Thank You


    Jalal

  2. #2
    jalal is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2012
    Posts
    17
    Hi
    For VBA for Forms on current event which you have provided is working well
    Private Sub Form_Current()
    If IsNull(Me.ReportTime) Then
    Me.ReportTime.Value = Format(Date, "d/m/yyyy") & " 9:50:00 AM"
    End If
    If IsNull(Me.ReportedAt) Then
    Me.ReportedAt.Value = Format(Now(), "hh-nn-ss ampm")
    End If
    End Sub

    But when I implement it on my form-subform after trying on number of attempts it gives error in calculating the LateByMinute

    In fact I am using two tables . Table1 (Master Table) consists two fields. as follows

    Table 1
    FieldName DataType
    ID Autonumber
    AttendenceDate Date/Time

    Table 2
    FieldName DataType Description
    ID Autonumber
    AttendenceDate Date/Time
    EmployeeID Number Inserted through Lookup Wizard from Employee table.
    StatusID Number inserted through Lookup Wizard from TableStatus having
    Status as 1. Present, 2. AbsentExcused, 3. Leave, 4. UnexcusedAbsent
    ReportTime Text (9.50AM on daily basis as default )
    ReportedAt Test Time when actually the employee reports for duty

    Attendencedate Number for joining as child link
    The question is that system should record the reporting time of employee who has actually reported (i.e. is present besides it should also record how many minutes the employee is late. i. e. LateByMinuts.

    Please help
    Thank You
    Jalal

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Reporting Time fixed as a daily variable
    By jalal in forum Access
    Replies: 2
    Last Post: 03-17-2012, 08:21 PM
  2. Replies: 1
    Last Post: 02-28-2012, 09:16 PM
  3. Replies: 0
    Last Post: 08-10-2011, 11:59 AM
  4. Replies: 4
    Last Post: 08-05-2010, 01:26 PM
  5. Refering to variable form names inside a variable
    By redpetfran in forum Programming
    Replies: 2
    Last Post: 05-21-2010, 01:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums