Choosing date from query

S

Secret Squirrel

I have a subform that lists employee review information. It is linked to my
main form by the employeeID. The subform is a continuous form and shows all
the past reviews for that employee. I want to be able to put on my main for
the next date that employee's review is due. But I need to add 1 year to the
last review date from the subform. How can I pull the most current review
date from the subform and add a year to it?
 
S

Steve Schapel

Squirrel,

In the header or footer of the subform, put a hidden textbox, set its
Format property to Short Date, and enter its Control Source like this:
=Max([ReviewDate])
Let's say you name this textbox LastReview.

Ok, now put a textbox on the main form, set its Format property to
whatever valid date format you prefer, and enter its Control Source like
this:
=DateAdd("yyyy",1,[NameOfYourSubform]![LastReview])
 
S

Secret Squirrel

Perfect! Thanks Steve!

Steve Schapel said:
Squirrel,

In the header or footer of the subform, put a hidden textbox, set its
Format property to Short Date, and enter its Control Source like this:
=Max([ReviewDate])
Let's say you name this textbox LastReview.

Ok, now put a textbox on the main form, set its Format property to
whatever valid date format you prefer, and enter its Control Source like
this:
=DateAdd("yyyy",1,[NameOfYourSubform]![LastReview])

--
Steve Schapel, Microsoft Access MVP

Secret said:
I have a subform that lists employee review information. It is linked to my
main form by the employeeID. The subform is a continuous form and shows all
the past reviews for that employee. I want to be able to put on my main for
the next date that employee's review is due. But I need to add 1 year to the
last review date from the subform. How can I pull the most current review
date from the subform and add a year to it?
 

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