Date + 30 days

S

susanmgarrett

This should be an easy one, but it's driving me bonkers.

I have a form into which a date is entered (requestdate).

The next field in the form (due date) and the table that backs the
form is usually 30 days plus the requestdate field.

I would like the form to automatically enter the 30+ date as the user
tabs through the duedate field and onto the next field.

However, sometimes the user will have to enter a different date as the
due date.

What code should I put in the form field or query field for duedate
that will give a default date of 30 + requireddate that will allow the
user to hand enter a date if the duedate is NOT 30+ requireddate? I
need this information to go into the table so that it may be pulled up
in other queries and reports.

Thank you very much for your assistance!

Regards

Susan M. Garrett
 
R

Rick Brandt

susanmgarrett said:
This should be an easy one, but it's driving me bonkers.

I have a form into which a date is entered (requestdate).

The next field in the form (due date) and the table that backs the
form is usually 30 days plus the requestdate field.

I would like the form to automatically enter the 30+ date as the user
tabs through the duedate field and onto the next field.

However, sometimes the user will have to enter a different date as the
due date.

What code should I put in the form field or query field for duedate
that will give a default date of 30 + requireddate that will allow the
user to hand enter a date if the duedate is NOT 30+ requireddate? I
need this information to go into the table so that it may be pulled up
in other queries and reports.

You can't use a default because that value is set before you even enter the
requestdate. In the AfterUpdate event of the requestdate control on the form
have code like...

Me!duedate = DateAdd("d", 30, Me!requestdate)
 
S

susanmgarrett

Thanks!

Used a variation of your suggestion in a macro and it works
beautifully. I appreciate the help.

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top