TimeDiff??

Steven Pyrah

New member
Local time
Today, 00:10
Joined
Jan 11, 2003
Messages
7
Hi

I am trying to calculate a time to go in an unbound text box. (shown in days format)

The time I am trying to calculate is the diference between my "start date" field and my "end date" field that would then be placed in the unbound field.

I know you use DateDiff but where do you put it and how???

Thanks
 
Steven,

On the AfterUpdate event on the EndDate textbox:

Dim intWeeks As Integer
If IsNull(Me.StartDate) Or IsNull(Me.EndDate) Then
MsgBox("Please enter both dates.)
Exit Sub
End IF

intWeeks = DateDiff("ww", Me.StartDate, Me.EndDate)

hth,
Wayne
 
does this work with dates as well?

I'm also in a fix such as his. Does that work with dates as well? I have a field to put in completed dates for safety training and was looking for help finding a function to generate a due date for the next time they need to train for that field. I know I need to make another text box but some of them will not be generating the same interger for the dates. Some will be a year from the date completed and some will be 2 years or even just 6 months. How do I make a function like that and where do I put that function in?

I'm not that well familiar with the Visual Basics part so I would also need step by step on how to get there adn where to put this information.

Please please help me.... I need this before tomorrow hopefully by tonight .. THANK YOU!!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom