Take value from table in between values (1 Viewer)

MushroomKing

Registered User.
Local time
Today, 13:02
Joined
Jun 7, 2018
Messages
100
Hi everyone. My "simple" code i cant get to work.
I want the application to close at a certain time.

So i have a table with a time in it to close. (i use a table because it needs to be able to be changed by the end user in some setup form).

So i want to the value from that table and use it as an inbetween. But it dont work, and doesnt give me an error either.

Anyone knows? Would be much appreciated :)

Code:
Private Sub Form_Timer()
Dim closingtime As String
closingtime = DLookup("timevalue", "closetime")
If Time() > closingtime And Time < TimeValue("05:30:00") Then
Application.Quit
End If
 

Minty

AWF VIP
Local time
Today, 20:02
Joined
Jul 26, 2013
Messages
10,355
Add a debug.print closingtime to see what you are actually comparing it to?

In fact you are declaring closingtime as a string, then using a time function to compare it against, I'm amazed that isn't generating an error... ?
 

Users who are viewing this thread

Top Bottom