Date + 30 days

  • Thread starter Thread starter susanmgarrett
  • Start date Start date
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
 
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)
 
Thanks!

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

Regards
 
Back
Top