This is the complete section of code that I am working on. I tried and failed with the dlookup and recordset at least with the if statement it is doing half of what I am trying to accomplish.
Dim lworkout As TempVars
Dim lmin As Integer
TempVars!lworkout = Me.frmClockIn_SUB!TimeOUT.Value
Me.txtLastworkout = TempVars!lworkout
lmin = DateDiff("n", Me.txtLastworkout, Now)
If lmin <= 240 Then
MsgBox "You must have a minimum 4 hours between Workouts!!"
DoCmd.OpenForm "frmHoursOfOperation"
DoCmd.Close acForm, "frmClockin"
Exit Sub
End If