K
Keith G Hicks
I'm putting the following function in the "Before Update" event of a date
control on a form like this:
=fncTestDateLimit()
Here's the function (it's in a regular module, not a form module):
Public Function fncTestDateLimit()
If Screen.ActiveControl < dteLowDateLimit Or dteDatePassed >
dteHighDateLimit Then
If MsgBox("Date entered is outside recommended bounds. Continue?",
vbYesNo + vbQuestion) = vbNo Then
Screen.ActiveControl.Undo
End If
End If
End Function
Where dteLowDateLimit and dteHighDateLimit are public variables set to
certain dates when the program starts.
The function is called just fine and there are no compile errors. But it
doesn't undo the value if the line "Screen.ActiveControl.Undo" runs.
Can anyone help me out here? Undo seems to be very persnikity. I always seem
to have trouble with it.
Thanks,
Keith
control on a form like this:
=fncTestDateLimit()
Here's the function (it's in a regular module, not a form module):
Public Function fncTestDateLimit()
If Screen.ActiveControl < dteLowDateLimit Or dteDatePassed >
dteHighDateLimit Then
If MsgBox("Date entered is outside recommended bounds. Continue?",
vbYesNo + vbQuestion) = vbNo Then
Screen.ActiveControl.Undo
End If
End If
End Function
Where dteLowDateLimit and dteHighDateLimit are public variables set to
certain dates when the program starts.
The function is called just fine and there are no compile errors. But it
doesn't undo the value if the line "Screen.ActiveControl.Undo" runs.
Can anyone help me out here? Undo seems to be very persnikity. I always seem
to have trouble with it.
Thanks,
Keith