Mark:
Me.[txtFollowUpDate] = DateAdd("ww",1,VBA.Date)
in the button's Click event procedure should do the trick, where
txtFollowUpDate is the name of the text box bound to the field. If youare
unsure about how to add code to an event procedure this is how its done:
Select the button in form design view and open its properties sheet if its
not already open. Then select the event property in the properties sheet.
Click on the 'build' button; that's the one on the right with 3 dots. Select
'Code Builder' in the dialogue, and click OK. The VBA window will openat
the event procedure with the first and last lines already in place. Enter
the line of code between these two existing lines.
If this is done when a new record is entered you could automate it by
putting the same code in the form's BeforeInsert event procedure. If its
only done when a new record is entered you'd then need no button at all, but
if it is also done when an existing record is edited you'd still need the
button, though you might possibly be able to automate it then too using some
other event.
Ken Sheridan
Stafford, England
radink said:
I have a text field so the user can put in a date to follow up.
What I'd like to have to add easier use is to have a command button
next to it to add a week to the current date, and then put it in the
field. I know i need to create some code, but not sure where to begin.