I've got a form which, on loading, sets a filter
Me.Filter = "Arrival>=" & SQLdate(dWhen) & " AND Arrival<=" & SQLdate(dLast)
Me.FilterOn = True
(SQLdate is a function which formats the date for me)
When I examine what it's supposed to be setting it shows me
Arrival>=#10/04/2010# AND Arrival<=#10/09/2010#
When the filter is turned on AND there are no records selected I get the error 2427, "You have entered an expression that has no value" and I'm not even able to trap this error with the normal 'On Error' stuff.
I click the OK button and everything works fine, the empty form opening as expected.
I've tried changing the filter rule but get the same effect, even when I make it really simple, which leads me to suspect that it may be something to do with the form.
I have another similar form working with a different table and different criteria on the filter but which has no objections to there being no records so what is it complaining about?
Maybe it's something strange with the way Access VBA has coded the statement?
Any ideas?
it's Access 2003 BTW
Me.Filter = "Arrival>=" & SQLdate(dWhen) & " AND Arrival<=" & SQLdate(dLast)
Me.FilterOn = True
(SQLdate is a function which formats the date for me)
When I examine what it's supposed to be setting it shows me
Arrival>=#10/04/2010# AND Arrival<=#10/09/2010#
When the filter is turned on AND there are no records selected I get the error 2427, "You have entered an expression that has no value" and I'm not even able to trap this error with the normal 'On Error' stuff.
I click the OK button and everything works fine, the empty form opening as expected.
I've tried changing the filter rule but get the same effect, even when I make it really simple, which leads me to suspect that it may be something to do with the form.
I have another similar form working with a different table and different criteria on the filter but which has no objections to there being no records so what is it complaining about?
Maybe it's something strange with the way Access VBA has coded the statement?
Any ideas?
it's Access 2003 BTW