date/time validation rule

shieriel

Registered User.
Local time
Today, 14:15
Joined
Feb 25, 2010
Messages
116
Is it possible to have a rule that when the difference of time1 to time2 exceeds 24hrs a confirmation box will pop-up with a message before proceeding?

I have a form for monitoring the time of a certain work. How can i make a pop-up message to inform the encoder that his encoded data is greater than, say 24hours and needs to double check?
 
Are your two times simply stored as times or do they also include a date component?
 
Are your two times simply stored as times or do they also include a date component?

They includes date components. I am monitoring the time duration for our products from starting time to end time and the format on my form is :

Example:
Start time = 03/22/10 10:00
End Time = 03/22/10 12:30

We have this monitoring for every product and i want to have a verification for the encoder to eliminate typographic errors. And also a message that shows when the time difference is less than 2hours,etc.
Is this possible?
 
You could put something like the following in Time2's Before Update event;
Code:
    If DateDiff("h", Me.Time1, Me.Time2) > 24 Then
        If MsgBox("Time entered greater than 24 hour. Is this correct?", vbYesNo) = vbNo Then
            Cancel = True
        End If
    End If
 
You could put something like the following in Time2's Before Update event;
Code:
    If DateDiff("h", Me.Time1, Me.Time2) > 24 Then
        If MsgBox("Time entered greater than 24 hour. Is this correct?", vbYesNo) = vbNo Then
            Cancel = True
        End If
    End If

Thank you so much sir John..:D
 

Users who are viewing this thread

Back
Top Bottom