Date Calculation

L

Lori

I am using Access 97 and need to create a simple form to
calculate a date.

I need to allow the user to enter an Effective Date and
then I need to calculate a date 60 days in the past from
the effective date. Effective Date - 60 = Calculated Date

How can I do this? I don't need to store this
information, I just need it as a easy calculator. Do I
need a source for the form? Can I have the fields be
unbound? I'm just not sure where to put my calculation
within the propeties.

Thanks for the help!
 
J

John Vinson

I am using Access 97 and need to create a simple form to
calculate a date.

I need to allow the user to enter an Effective Date and
then I need to calculate a date 60 days in the past from
the effective date. Effective Date - 60 = Calculated Date

How can I do this? I don't need to store this
information, I just need it as a easy calculator. Do I
need a source for the form? Can I have the fields be
unbound? I'm just not sure where to put my calculation
within the propeties.
Set the Control Source property of a textbox to

=DateAdd("d", -60, [Effective Date])
 
L

Lori

Thanks John! It worked great....is there a way to default
the date fields to null or blank upon opening the form? I
usually use an event procedure in the form properties to
default to a new record but this form isn't tied to a
table with records. Thanks!

-----Original Message-----
I am using Access 97 and need to create a simple form to
calculate a date.

I need to allow the user to enter an Effective Date and
then I need to calculate a date 60 days in the past from
the effective date. Effective Date - 60 = Calculated Date

How can I do this? I don't need to store this
information, I just need it as a easy calculator. Do I
need a source for the form? Can I have the fields be
unbound? I'm just not sure where to put my calculation
within the propeties.
Set the Control Source property of a textbox to

=DateAdd("d", -60, [Effective Date])



.
 
J

John Vinson

Thanks John! It worked great....is there a way to default
the date fields to null or blank upon opening the form? I
usually use an event procedure in the form properties to
default to a new record but this form isn't tied to a
table with records. Thanks!

Set the textbox to Null in the Form's Current event.
 

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