Help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
 
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.
 
Hi RG

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

Thanks Sandy
 
Hi Nick,

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

Thanks
Sandy
 
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.
 

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

Similar Threads


Back
Top