[AccessD] Date function for adding year based on current month and year

Stuart McLachlan stuart at lexacorp.com.pg
Tue Mar 15 19:57:14 CST 2005


On 16 Mar 2005 at 11:34, connie.kamrowski at agric.nsw.go wrote:
> 
> 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.
> 

Why have them enter an End Date at all.

Just calculate  it in the Form.Before_Update

EndYear = year(startdate)
If Month(startdate) >4  then EndYear = EndYear + 1
EndDate = DateSerial(EndYear,6,30)




-- 
Stuart





More information about the AccessD mailing list