Adding timeframes to database

D

Dalocky

I have a set of timeframes under a priority. How can I get the date to
default when a priority is selected, eg Priority is 8 weeks, due date from
today would be?????
 
D

Dorian

Look up the date functions in Access Help, specifically the DateAdd and
DateDiff functions.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
D

Dalocky

Thanks Dorian

Have tried this and I kept getting caught out with the second date as it is
shown as 1 week (7 days) or 8 weeks (60 days). How can I do the due date
with the priority required (selected).

Ness
 
K

kc-mass

Let's assume you have a combo box, cboPriority where you
pick priorities. The number of days is in column1
(remember it's zero based). Priority1 is 7 days, Priority2 is 30
days, Priority3 is 60 days or whatever. Your math would then
be something like:
dteNeeded = dateadd("d",ME.cboPriority.Column(1),Date())

That would add the number of days related to your priority
designator to today's date and return a date.

Regards

Kevin
 
D

Dalocky

Thanks Guys

I have written the code as

Private Sub_DueDate
Dim strPriority As String
Dim strDuedate As Date
dteNeeded = DateAdd("d", cboPriority.Column(1), Date)
dteNeeded = DateAdd("d", cboPriority.Column(2), Date)
dteNeeded = DateAdd("d", cboPriority.Column(3), Date)

I know I am missing something. It has been a couple of years since I played
in Access with VB.
 
D

Dalocky

Thanks Bruce, that helped heaps.

Stupid question, having a blonde moment what is Me???

Ness
 

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