Darren DICK
d.dick at uws.edu.au
Tue Mar 15 19:38:51 CST 2005
Hi Connie Dunno if I read this right but Just check to see if start date is in May or not and add 2 years to a predefined date (or not) Private Sub txtStartDate_AfterUpdate() Dim dtMayDate As Date Dim dtNonMayDate As Date dtMayDate = Format("30/06/" & Year(Date) + 2, "dd/mm/yyyy") dtNonMayDate = Format("30/06/" & Year(Date), "dd/mm/yyyy") If Month(Me.txtStartDate) = 5 Then 'It's a May date Me.txtEndDate = dtMayDate Else Me.txtEndDate = dtNonMayDate End If End sub HTH See ya Darren -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of connie.kamrowski at agric.nsw.gov.au Sent: Wednesday, 16 March 2005 11:34 AM To: accessd at databaseadvisors.com Subject: [AccessD] Date function for adding year based on current month andyear Hi all, I have been virtually trouble free for a while but as usual I have been asked to do something I am not sure how to go about it. can someone please point me in the right direction. I have a form with a start and an End date on it. I need to restrict the end date in the following way. End Date -- should only accept the following 30th June except where start date is in May (and then it should only accept the second 30th June from the start date). Any suggestions appreciated including telling me where to RTFM. Connie Kamrowski Analyst/Programmer Information Technology NSW Department of Primary Industries Orange This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient or received it in error, please delete the message and notify sender. Views expressed are those of the individual sender and are not necessarily the views of their organisation. -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com