I need to have the following time in/out code and a specific date for a two week period to populate a specific field in a form. The "PayPeriod" is the trigger for the event, I need help with the rest of the code to have the payperiod subtracted from 1 through 13 to get the correct work date. What I need to end up with is a field that looks like 6/22/2008 7:00 AM. I think that I need to format the time in/out and the date to strings and then concatenate them, I just do not know the steps to go about it.
Any help would be appreciated.
Thank you
Any help would be appreciated.
Thank you
Code:
Private Sub PayPeriod_AfterUpdate() Dim rs As Recordset, " _
Dim strSQL As String Dim i As Integer Dim strDayNum As String, " _
Dim strDayAMIn As String Dim strDayPMIn As String, " _
Dim strDayAMOut As String Dim strDayPMOut As String, " _
Dim strFldWorkdayWorked As String Dim strTemp As String , " _
'Query the employee table for the employee in question, " _
strSQL = "Select * from tbl_EmployeeData WHERE [Employee#]='" &, " _
EmployeeNo & "'" Set rs = CurrentDb.OpenRecordset(strSQL), " _
'For each day, check if scheduled to work, " _
For i = 1 To 14 strTemp = "00" & Trim(Str(i)), " _
strDayNum = Right(strTemp, 2) , " _
' if scheduled, then fill in default hours from record, " _
strFldWorkdayWorked = "WKDay" & strDayNum , " _
If rs.Fields(strFldWorkdayWorked) Then , " _
strDayAMIn = "Day" & strDayNum & "InAM" , " _
strDayPMIn = "Day" & strDayNum & "InPM" , " _
strDayAMOut = "Day" & strDayNum & "OutAM", " _
strDayPMOut = "Day" & strDayNum & "OutPM" , " _
Me.Controls(strDayAMIn).Value = rs!InAmTime , " _
Me.Controls(strDayPMIn).Value = rs!InPmTime , " _
Me.Controls(strDayAMOut).Value = rs!OutAmTime, " _
Me.Controls(strDayPMOut).Value = rs!OutPmTime, " _
End If , " _
Next 'Close recordset rs.Close Set rs = Nothing , " _
DoCmd.RunMacro "mcr_runcalchours"End Sub