IF condition

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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 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
 
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

Time difference and If function 4
Calculatting Time difference 1
Adding timer to text box 1
Timer Code 7
hh:mm:ss on a timer 2
VBA HELP PLEASE!!!! 2
Use Stopwatch to trigger event 2
Timer gettin complicated! 4

Back
Top