PC Review


Reply
Thread Tools Rate Thread

Adding timeframes to database

 
 
Dalocky
Guest
Posts: n/a
 
      13th Apr 2010
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?????
--
Vanessa Nuttall
Pavement Maintenance Technican
 
Reply With Quote
 
 
 
 
Dorian
Guest
Posts: n/a
 
      13th Apr 2010
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".


"Dalocky" wrote:

> 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?????
> --
> Vanessa Nuttall
> Pavement Maintenance Technican

 
Reply With Quote
 
Dalocky
Guest
Posts: n/a
 
      13th Apr 2010
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
--
Vanessa Nuttall
Pavement Maintenance Technican


"Dorian" wrote:

> 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".
>
>
> "Dalocky" wrote:
>
> > 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?????
> > --
> > Vanessa Nuttall
> > Pavement Maintenance Technican

 
Reply With Quote
 
kc-mass
Guest
Posts: n/a
 
      13th Apr 2010

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

"Dalocky" <(E-Mail Removed)> wrote in message
news:F5076821-D56C-43EB-B003-(E-Mail Removed)...
> 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
> --
> Vanessa Nuttall
> Pavement Maintenance Technican
>
>
> "Dorian" wrote:
>
>> 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".
>>
>>
>> "Dalocky" wrote:
>>
>> > 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?????
>> > --
>> > Vanessa Nuttall
>> > Pavement Maintenance Technican



 
Reply With Quote
 
Dalocky
Guest
Posts: n/a
 
      13th Apr 2010
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.
--
Vanessa Nuttall
Pavement Maintenance Technican


"Dalocky" wrote:

> 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?????
> --
> Vanessa Nuttall
> Pavement Maintenance Technican

 
Reply With Quote
 
Dalocky
Guest
Posts: n/a
 
      14th Apr 2010
Thanks Bruce, that helped heaps.

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

Ness
--
Vanessa Nuttall
Pavement Maintenance Technican


"BruceM via AccessMonster.com" wrote:

> The code you have written assumes a combo box Row Source of at least four
> columns, with numbers in the second, third, and fourth columns. The first
> column would be numbered Column(0), the second Column(1), etc. The combo box
> properties would have to allow for the correct number of columns in Column
> Count, where you would add the actual number of columns (i.e. it is not zero-
> based numbering on the property sheet). Use the Column Widths to show or
> hide columns.
>
> BTW, you have declared two variables, strPriority and strDueDate, that you do
> not use in the code; and you have what seems to be an undeclared variable:
> dteNeeded. On another point, it will be clearer when reading the code if you
> use different prefixes for different data types. For instance, strPriority
> would be a string (text), and datDueDate would be a date.
>
> You could have a two column Row Source query like this:
>
> 4 Weeks 4
> 8 Weeks 8
>
> The Column Count would be 2, and the Column Widths something like 1.5";0"
>
> The combo box (cboPriority) After Update event could be:
>
> Me.TextBoxName = DateAdd("ww",Me.cboPriority.Column(1),Date)
>
> If you want to use days or other time units (along with weeks) for DateAdd
> you could have this:
>
> 5 Days 5
> 4 Weeks 28
> 8 Weeks 56
>
> The After Update expression would be:
>
> Me.TextBoxName = DateAdd("d",Me.cboPriority.Column(1),Date)
>
> TextBoxName is an unbound text box in which you display the expression result.
>
>
> You could adjust the expression depending on whether it is days, weeks, or
> months, but that would involve some extra steps.
>
> A futher thought is that you could have this as the Row Source:
>
> 5 5 Days
> 28 4 Weeks
> 56 8 Weeks
>
> Column Widths 0";1.5:
> Column Count 2
> Bound Column 1
>
> If the value you need is in the bound column, no need to specify the column:
>
> Me.TextBoxName = DateAdd("d",Me.cboPriority,Date)
>
> You could also add the number to an unbound text box, and select the unit of
> time from a combo box. I won't get into details, but rather want to point
> out there are a lot of options, depending on your specific needs.
>
>
> Dalocky wrote:
> >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.
> >> 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?????

>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...dules/201004/1
>
> .
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a chart to track entries across timeframes jjohnston Microsoft Excel Worksheet Functions 0 13th Aug 2007 09:55 PM
Joining two tables based on timeframes =?Utf-8?B?Y2hvd2Rh?= Microsoft Access Queries 6 9th Nov 2006 07:25 PM
splitting out timeframes =?Utf-8?B?c29waA==?= Microsoft Excel Misc 1 20th Sep 2005 09:43 AM
How to graph series with different timeframes AlekM Microsoft Excel Misc 2 17th Mar 2004 03:57 AM
Report Data based on two different timeframes Libby Microsoft Access Reports 1 10th Feb 2004 04:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:56 AM.