Applying a filter to a subform on opening main form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
This may be easy, but I can't figure out how to do it. I have a main form
that has several tabs with subforms on each of them. When the main form
opens up, I would like to have the subform default to show me records only
from the year 2007. I have the Year field on the main and sub forms, but the
filter property isn't working. I read that the Wherecondition won't work on
a subform, so how can I do this?
Any help is greatly appreciated.

krista
 
Assuming that "2007" is a value in a textbox on the main form then, in
the query for the subform, in the criteria line for the Year field,
refer to the value in the textbox on the main form:

like forms!frmMyMainForm!txtYear

HTH
 
Back
Top