On Wed, 1 Oct 2003 14:09:21 +0000 (UTC), "Tony Williams" <(E-Mail Removed)>
wrote:
>I have a form that has a control DateDestroytxt and a control DocTypetxt. I
>want the DateDestroytxt date to be a number of months in the future which
>are dependent upon the type of document in Doctypetxt eg if doctypetxt is a
>letter the dateDestroytxt date should be 6 months after today. I know I can
>use the DateAdd function but how do I add months and make it dependent on
>the Doctypetxt control?
>TIA
>Tony
>
>
Just reference the Doctypetxt control in your call to DateAdd:
DateAdd("m", Choose([Doctypetxt] = "Letter", 6, [Doctypetxt] = "Memo",
1, ...), Date())
You may want instead to create a Retention table with document types
and the retention period for that document type, or add a retention
period field to the table of document types. You could then simply
look up the retention using DLookUp.
John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public