i haven't seen this in the forum yet so here goes...
i don't like the way Access deletes records on the fly. i'd rather they just be marked and then removed when the user decides they're not useful anymore. Form opens with a table, one field of which is a marker "Deleted." i'd like to code a button that toggles a filter between showing Deleted records and hiding Deleted records.
So far no luck...
i keep commenting things out so if i happen on the right combination i don't have to go back to square one. The last two lines do work, but don't allow me to toggle it on and off, just off.
Any ideas?
Thanks,
Dave
i don't like the way Access deletes records on the fly. i'd rather they just be marked and then removed when the user decides they're not useful anymore. Form opens with a table, one field of which is a marker "Deleted." i'd like to code a button that toggles a filter between showing Deleted records and hiding Deleted records.
So far no luck...
Code:
Private Sub btnFilterDeleted_Click()
' Me.FilterOn Me.Deleted = False
'DoCmd ApplyFilter(Me.Deleted = False)
'strfilter = False
Me.FilterOn = Not Me.FilterOn
If Me.FilterOn = True Then
Me.Filter = Deleted = False
Else
Me.Filter = Deleted = True
End If
'Me.Filter = IIf(Me.FilterOn = True, Me.Deleted = False, Me.Deleted = True)
'[Forms]![frmMainForm].Filter = strfilter
'[Forms]![frmMainForm].FilterOn = True
End Sub
Any ideas?
Thanks,
Dave