Automating dates

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

Guest

I have an install date and i want to automat a service date for either 3,6,12
months after install date. I have put in code to add 90, 180, 365 days to
the install date to do this and this works fine. All the user has to do is
pick 3, 6 12 from the frequency field and the correct service date will go
into the service date field. What i want to no is do you have to use days in
the coding or can i put in 3,6 months or 1 year.
Natasha
 
Natasha,

Check out the DateAdd function in Help, the answer is there; you'll find
you can add whatever you like.

HTH,
Nikos
 
Hi, Natasha.

You could provide a list box with your 3 choices, then generate a string
once the item is chosen. Use that string to drive a SELECT statement:

SELECT CASE strListBoxResult
CASE "3 months"
code to add 90 days
CASE "6 months"
code to add 180 days
CASE "12 months"
code to add 365 days
END SELECT

Alternatively, create a FRAME containing radio buttons for the options. The
Select statement then becomes:

SELECT CASE Me.FrameControl
CASE 0
code to add 90 days
CASE 1
code to add 180 days
CASE 2
code to add 365 days
END SELECT

Hope that helps.
 
The DateDiff() and DateAdd() functions both take units of:

Setting Description
yyyy Year
q Quarter
m Month
y Day of year
d Day
w Weekday
ww Week
h Hour
n Minute
s Second
 
Back
Top