I haven't done this in a while so maybe what I'm trying to do can't be done the way I'm doing it so I need more brain power please. I'm trying to add the total hours worked for my employees for each pay period.
Here is my code
Dim stremployee As String
Dim dtmstart As Date
Dim dtmend As Date
Dim dbltotalhrs As Double
Dim dblreg As Double
Dim dblvac As Double
Dim dblsick As Double
Dim dblfloater As Double
Dim dblvto As Double
Dim dblother As Double
dtmstart = Nz(Format(Me.dtmstart.Value, "mm/dd/yyyy"))
dtmend = Nz(Format(Me.dtmend.Value, "mm/dd/yyyy"))
stremployee = Nz(Me.cbemployee.Value)
dbltotalhrs = DSum("[Hours Worked]", "tblemployeehistory", "[Employee Name] = """ & stremployee & """" And _
"[Date Worked]BETWEEN & #" & dtmstart & "# AND #" & dtmend & "#")
MsgBox dbltotalhrs
Here is my code
Dim stremployee As String
Dim dtmstart As Date
Dim dtmend As Date
Dim dbltotalhrs As Double
Dim dblreg As Double
Dim dblvac As Double
Dim dblsick As Double
Dim dblfloater As Double
Dim dblvto As Double
Dim dblother As Double
dtmstart = Nz(Format(Me.dtmstart.Value, "mm/dd/yyyy"))
dtmend = Nz(Format(Me.dtmend.Value, "mm/dd/yyyy"))
stremployee = Nz(Me.cbemployee.Value)
dbltotalhrs = DSum("[Hours Worked]", "tblemployeehistory", "[Employee Name] = """ & stremployee & """" And _
"[Date Worked]BETWEEN & #" & dtmstart & "# AND #" & dtmend & "#")
MsgBox dbltotalhrs