Date error in code

A

at

I have a database that is used on a network by 3 - 4 users. One of the forms
in the database has a subform that has a Total field at the bottom. One of
the users gets a flickering "#Error" in the total field in certain records.
The subform itself contains a field for quantity and a field for a beginning
date and an ending date. There is a buttom in the form footer that when the
users clicks on it, it finds the earliest beginning date and the latest
ending date based on the data in the subform. It then updates a field in the
main form. When I step through the code, it errors at the first if
statement. It says there is no value for the expression you entered. Then
the #Error sign shows up in the total field. Here is my code.

Dim datMin As Date
Dim datMax As Date

If IsNull(Me.MinDate) Then
MsgBox "You must enter a beginning date"
Else
datMin = Me.MinDate
End If
If IsNull(Me.MaxDate) Then
MsgBox "You must enter an ending date."
Else
datMax = Me.MaxDate
End If

Thanks for any help anyone can give me.

at
 
Top