hey dirk, it's me again
now that we managed to lick the thorny incremental issue on subform
'DaysView', i returned to this thread wherein i added the reference
to the Me.NavigationButtons in the code below. once i do, and test
it, what i find is that if i'm on say the third mainform record,
apply the filter, then remove the filter, that it takes me to the
first record's mainform page. something a little like this was
happening in the other thread because a Me.Requery was not written to
accomodate the fact that the subform DaysView needed to be requeried
-- once it was, that seemed to calm things down a bit, but i don't
see any requerying going on in this instance.
-ted
Private Sub FilterDates_Click()
On Error GoTo Err_FilterDates_Click
With Me.[DaysView].Form
If .FilterOn Then
.FilterOn = False 'Turn the filter off.
lngGreen = RGB(0, 150, 0)
Me.FilterDates.ForeColor = lngGreen
Else
.Filter = "[DateOfVisit] >= Date()"
.FilterOn = True
lngRed = RGB(225, 0, 0)
Me.FilterDates.ForeColor = lngRed
End If
End With
If Me.FilterDates.ForeColor = lngRed Then
Me.FilterLbl.Visible = True
Me.Close.Visible = False
Me.Add_Record.Visible = False
Me.NavigationButtons = False
Else
Me.FilterLbl.Visible = False
Me.Close.Visible = True
Me.Add_Record.Visible = True
Me.NavigationButtons = True
End If
Exit_FilterDates_Click:
Exit Sub
Err_FilterDates_Click:
MsgBox Err.description
Resume Exit_FilterDates_Click
End Sub