Using Time Functions ??? 
Author Message
 Using Time Functions ???

Hello everybody,

I try to execute a program automatically with the time function, but my
program doesn't work :

Dim MyTime

Private Sub Command1_Click()
MyTime = #7:19:20 PM#
If MyTime = CURRENT_TIME Then
    Beep
    MsgBox "Ca Marche !!", vbInformation
End If

End Sub

Is there anyone able to help me ?

Many thanks from Paris
Philippe



Sat, 01 Sep 2001 03:00:00 GMT  
 Using Time Functions ???

Yes and the comparison is a bit wierd, try datediff.

You might want to try a timer control with a faily small interval and
the datediff funtion.  It would look like the follow, I did test it
and it works.

Private Sub Timer1_Timer()
Dim MyTime As Date
MyTime = #7:07:30 AM#
If DateDiff("s", Time, MyTime) = 0 Then
    Beep
    MsgBox "Ca Marche !!", vbInformation
End If
End Sub



Sun, 02 Sep 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using Time Functions ???

2. using stopeatch form functions to time an event procedure and update elapsed time control

3. Using custom Access function with VB5 (Run-time error 3085) - Mimmo Spadavecchia

4. Calculating Time Difference using DateDiff Function in VBScript

5. Using VBA time functions with excel macro

6. NEED BIG TIME HELP USING RegEnumValue function (Win32API) !!!!

7. DateAdd function using time and date

8. NEED BIG TIME HELP USING RegEnumValue function (Win32API) !!!!

9. NEED BIG TIME HELP USING RegEnumValue function (Win32API) !!!!

10. NEED BIG TIME HELP USING RegEnumValue function (Win32API) !!!!

11. Need function to increase time in date/time field by one hour

12. Crystal Reports, Date/Time, and the Time() function

 

 
Powered by phpBB® Forum Software