Filtering no longer works after converting to access 2000

J

Jim

The following code behind the form works fine in access 97, but once
the database is converted to access 2000, running this returns no
records. Running the query standalone works, it just doesn't seem to
work from the screen. Has there been a change from access 97 to access
2000 that may affect this type of code that I've missed? any help is
greatly appreciated!!!

Private Sub Requires_Tracking_Info_Filter_Click()
On Error GoTo Err_Requires_Tracking_Info_Filter_Click


If IsNull(Me![requires tracking info filter]) And IsEmpty(Me![requires
tracking info filter]) Then
TrackParmFilter = Null
Else
TrackParmFilter = "([IL Number] = null And [Event] = Null And
[Comments] = Null)"
End If
Apply_Filter (TrackParmFilter)
Me.Refresh
DoCmd.GoToControl "[Team Filter]"

Exit_Requires_Tracking_Info_Filter_Click:
Exit Sub

Err_Requires_Tracking_Info_Filter_Click:
MsgBox Err.Description
Resume Exit_Requires_Tracking_Info_Filter_Click

End Sub
 
J

John Nurick

Hi Jim,

([IL Number] = null And [Event] = Null And [Comments] = Null)

This condition will never be true. Null by definition represents an
unknown value, so the result of any test for equality involving Null is
itself unknown - so the test itself returns Null.

To get round this, VBA has the IsNull() function and SQL the IS NULL
syntax:

(([IL Number] IS NULL) AND ([Event] IS NULL) AND ([Comments] IS NULL))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top