IF condition

G

Guest

I have the following function where I am calculating time difference between
current time and the last update and I am updating timer every minute. How
do I set up if function to display warning message if difference is > 60
minutes? Also is it possible to insert into this if condition to change form
background color if time difference is > 60 minutes. Thanks. Here is the
function:

Private Sub Form_Timer()

Dim sngElapsedTime As Date
Dim Last_Update As Date

sngElapsedTime = Now() - [Last Update]
'Update the timer
txtTimeDiff = Format(sngElapsedTime, "hh:mm:ss")

End Sub
 
F

Federico Lemos

I have the following function where I am calculating time difference between
current time and the last update and I am updating timer every minute. How
do I set up if function to display warning message if difference is > 60
minutes? Also is it possible to insert into this if condition to change form
background color if time difference is > 60 minutes. Thanks. Here is the
function:

Private Sub Form_Timer()

Dim sngElapsedTime As Date
Dim Last_Update As Date

sngElapsedTime = Now() - [Last Update]
'Update the timer
txtTimeDiff = Format(sngElapsedTime, "hh:mm:ss")

End Sub
 
F

Federico Lemos

I have the following function where I am calculating time difference between
current time and the last update and I am updating timer every minute. How
do I set up if function to display warning message if difference is > 60
minutes? Also is it possible to insert into this if condition to change form
background color if time difference is > 60 minutes. Thanks. Here is the
function:

Private Sub Form_Timer()

Dim sngElapsedTime As Date
Dim Last_Update As Date

sngElapsedTime = Now() - [Last Update]
'Update the timer
txtTimeDiff = Format(sngElapsedTime, "hh:mm:ss")

End Sub
 
G

Guest

Federico Lemos said:
I have the following function where I am calculating time difference between
current time and the last update and I am updating timer every minute. How
do I set up if function to display warning message if difference is > 60
minutes? Also is it possible to insert into this if condition to change form
background color if time difference is > 60 minutes. Thanks. Here is the
function:

Private Sub Form_Timer()

Dim sngElapsedTime As Date
Dim Last_Update As Date

sngElapsedTime = Now() - [Last Update]
'Update the timer
txtTimeDiff = Format(sngElapsedTime, "hh:mm:ss")

End Sub

I can not find this article.
 

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

Similar Threads


Top