Help

S

Sandy

I have created a database which on the whole works fine, however I am tryig
to put some options into the main for which should enter the data in to the
main data table. the problem that I have is that :

1 - there are 2 dates one a starting date and the other a date for
completion, these dates can vary from 2 months up to 2 years.

2 - what I am trying to achieve is to be able on the form to select an
option ie in the form of tick box or equivalent that would add the required
time to the date. ie if the start date is 01/02/03 and a response is required
within 3 months I would select the 3 month option and the date would
automatically be adjusted to 01/05/03

Many Thanks in advance for any help

Sandy
 
N

Nick Stansbury

Sandy,

You need to look at the DateAdd function - so this code would add three
months to a date you specified:

DateAdd("m", 3, "31-Jan-95")

Hope this helps,

Nick

DateAdd Function
Returns a Variant (Date) containing a date to which a specified time
interval has been added.
Syntax : DateAdd(interval, number, date)
 
R

RuralGuy

Hi Sandy,

Are you looking for Me.EndDate = DateAdd("m", 3, Me.StartDate)?

I have created a database which on the whole works fine, however I am tryig
to put some options into the main for which should enter the data in to the
main data table. the problem that I have is that :

1 - there are 2 dates one a starting date and the other a date for
completion, these dates can vary from 2 months up to 2 years.

2 - what I am trying to achieve is to be able on the form to select an
option ie in the form of tick box or equivalent that would add the required
time to the date. ie if the start date is 01/02/03 and a response is required
within 3 months I would select the 3 month option and the date would
automatically be adjusted to 01/05/03

Many Thanks in advance for any help

Sandy

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
S

Sandy

Hi RG

Think this may be an answer, but not to sure of the coding (pretty new to
VB) any suggestions

Thanks Sandy
 
S

Sandy

Hi Nick,

Have tried this one but could not get it working right - any suggestions

Thanks
Sandy
 
R

RuralGuy

Hi Sandy,
If the StartDate control is bound to a Date field in the underlying query/table
then Access will not allow a value that is not valid so you can put something
like the code I posted in the AfterUpdate event of the StartDate control and it
would fill in the EndDate field as soon as you left the StartDate control.

Hi RG

Think this may be an answer, but not to sure of the coding (pretty new to
VB) any suggestions

Thanks Sandy

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
Top