S
SuzyQ
I have the follow code on a date text box format is short date, control
source is date type field. Access 2000. I've stepped though the code and it
does not matter whether the date entered is in the range or not, the if
me.dateworked... statement is evaluated to true regardless, and the update is
cancelled and date is not accepted. If the user is using a filter on the
parent form, then when they are entering timecards the dates must be within
the filtered range. I have stepped through the code and the values seem to
be correct to do what I intend, but I can't get past this field.
Private Sub DateWorked_BeforeUpdate(Cancel As Integer)
If Me.FilterOn = True Then
If Not (Me.DateWorked >= Me.Parent.cmbPayPeriod.Column(1) And
Me.DateWorked <= Me.Parent.cmbPayPeriod.Column(2)) Then
MsgBox "Date not within range selected" & vbCrLf & "Remove
filter or change date"
Cancel = -1
End If
End If
End Sub
source is date type field. Access 2000. I've stepped though the code and it
does not matter whether the date entered is in the range or not, the if
me.dateworked... statement is evaluated to true regardless, and the update is
cancelled and date is not accepted. If the user is using a filter on the
parent form, then when they are entering timecards the dates must be within
the filtered range. I have stepped through the code and the values seem to
be correct to do what I intend, but I can't get past this field.
Private Sub DateWorked_BeforeUpdate(Cancel As Integer)
If Me.FilterOn = True Then
If Not (Me.DateWorked >= Me.Parent.cmbPayPeriod.Column(1) And
Me.DateWorked <= Me.Parent.cmbPayPeriod.Column(2)) Then
MsgBox "Date not within range selected" & vbCrLf & "Remove
filter or change date"
Cancel = -1
End If
End If
End Sub