This is a "best practice" type question rather than a "help me".
I am using this code as a filter on a checkbox:
Code:
Private Sub ChkNullDate_Click()
If Me!ChkNullDate = True Then
Me.Filter = ""
Else
Me.Filter = "IsNull(Date_Completed)"
End If
Me.FilterOn = True
Me.Requery
Me.Refresh
End Sub
The problem I face is; when I refresh the form as standard it will show all results regardless of the check box status. I can easily add that code to every refresh event but im wondering if I can put the checkbox status in the query?
Any ideas appreciated.
Thank you.
Andrew.
Edit: I see my title has a spelling mistake but im unable to correct.
Update: in the criteria for "Date complete" I've tried using this code unsucessfully
Code:
IIf([Forms]![Order_list]![ChkNullDate]=-1,-1,0)
this isnt exactly how I want it but anything working wouldbe a good start. Is there any reason this sint working?