Applying a filter to a subform on opening main form

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
 
L

Larry Daugherty

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top