Property Control Source in Sub Form

G

Guest

I have a subform within a main form. In the subform instead of displaying all
records, I only want to display the record from last year plus allow input of
this years data.
Right now I have 2002 data, 2003 data, 2004 data & I can enter (new record)
2005 data. I have a field QtyYear that contains the year so how do I display
just last years & allow me to enter this year ? I thought I could modify
control source property for QtyYear but no luck. Thanks
 
G

Guest

Hi Nigel

Open up the subform in design view. Change its Record Source to a query with
the appropriate parameter. Presumably, the subform should show data from 2004
and 2005. You could put "'2004' OR '2005'" in the criteria part of the query
grid under the QtyYear field. (Assuming it's a string field.)

If you want the subform to always show you records from the current year and
the previous year (not always 2004 and 2005), it's a bit more tricky. The
function you want is called DatePart.

Cheers

David
 
G

Guest

Thanks for the insight ... ... I tested > 2003 that worked. Now to learn
about DatePart so that I don't hardcode the year. Thanks
 

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

Top