Yakman said:
Thank you for your reply.
I used
Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm "frmTermDates", _
WhereCondition:="CurrentYear = 'Yes'"
End Sub
and this works, but i tried using it on the "On Open", "On Load" and
"Before Update" but this will only display the CurrentYear='Yes'
records. If i add next years term dates, i would like to be able to
display these also.
Thanks
Yakman
I'm not at all sure I understand what you're saying. Are you talking
about putting the code in the Open event of the form that is displaying
the term dates -- "frmTermDates" in my example code? That's not the way
I intended it, and the code is overkill for that purpose.
I assumed that you wanted the form to normally display all records, if
you just opened it from the database window, but that you wanted a way
to open the form from, say, a command button, and in that particular
case show only the current year's records. If this is not what you had
in mind, you'd better explain exactly what you have now and what you
want, in more detail. I get the feeling that you may only need a way to
filter the form for "CurrentYear = 'Yes'", and to turn that filter on
and off at will, but I'm really not sure.