Hellow,
I have code to filter a subform which works OK below - it basically applies a filter in the field LOG TYPE from a combobox called FILTERS
If the combobox contains nothing it returns all records.
I would like to alter the code to work pretty much the same, but return all records if the combobox contains nothing or the word "ALL"
My attempt is the second block of code, but it caused my whole program to crash!!!!
Can someone show me the way???
Thanks, Mark
Private Sub FILTERS_AfterUpdate()
If Len(Nz(FILTERs, "")) > 0 Then
Forms![#edit_details]![#MASTER_LOGS].Form.FILTER = "[LOG TYPE]= '" & FILTERs & "'"
Forms![#edit_details]![#MASTER_LOGS].Form.FilterOn = True
Else
Forms![#edit_details]![#MASTER_LOGS].Form.FILTER = ""
Forms![#edit_details]![#MASTER_LOGS].Form.FilterOn = False
End If
End Sub
I have code to filter a subform which works OK below - it basically applies a filter in the field LOG TYPE from a combobox called FILTERS
If the combobox contains nothing it returns all records.
I would like to alter the code to work pretty much the same, but return all records if the combobox contains nothing or the word "ALL"
My attempt is the second block of code, but it caused my whole program to crash!!!!
Can someone show me the way???
Thanks, Mark
Private Sub FILTERS_AfterUpdate()
If Len(Nz(FILTERs, "")) > 0 Then
Forms![#edit_details]![#MASTER_LOGS].Form.FILTER = "[LOG TYPE]= '" & FILTERs & "'"
Forms![#edit_details]![#MASTER_LOGS].Form.FilterOn = True
Else
Forms![#edit_details]![#MASTER_LOGS].Form.FILTER = ""
Forms![#edit_details]![#MASTER_LOGS].Form.FilterOn = False
End If
End Sub