Use after update to change dates

StampIT
StampIT used Ask the Experts™
on
In an Access form there are two text boxes(StDate, EndDate) that represent a date range. The default property is set at Date()-1 for StDate and Date() for EndDate. There are two more text boxes(StDate2, EndDate2) that are also a date range. StDate2 and EndDate2 are dependent on StDate and EndDate. All of these can be initially set in the text box porperties. However if the user changes the StDate I would like to use the After Update event to change the second date range accordingly. What code would be necessary to accomplish this ? StDate2 and EndDate2 are 1 day less than stDate and EndDate.  Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
private sub  StDate_afterupdate()

me. StDate2=DateAdd("d",-1, me.StDate)

end sub

private sub endDate_afterupdate()

me.endDate2=dateadd("d",-1,me.endDate)

end sub

Author

Commented:
Works perfectly. Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial