Problems with the "time" cmd in visual basic

K

KosLooney

Hello,

I have a reservationsystem wich works with timeblocks.
When the real time gets past a pre-set time the timeblocks should open.

All timeblocks past 10:00 (10:00, 11:00, 12:00, 13:00 etc) works perfectly, only the ones before 10:00 (8:00 and 9:00) dont work.

The code:

If Time < "9:30:00" Or Time > "10:50:00" Then
Me.verlopen.Visible = True
Me.reserveren.Visible = False
achternaam.BackColor = vbRed
PK_lidnr.BackColor = vbRed

Else

If Me.RecordsetClone.RecordCount = 0 Then
Me.reserveren.Visible = True
Else
Me.reserveren.Visible = False
End If
End if

When the time is 9:59 the timeblock is closed and at 10:00 its open...
It just doesnt recognize the 8 and 9 hour.
I tryed to put a 0 for the 8 and 9, like 09:30 but that wouldnt work either.

Hopefully someone knows a solution for this..TIA


--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-
 
S

Steve Schapel

Kos,

You should use # rather than " as the delimiter for time values. For
example...
If Time < #9:30# Or Time > #10:50# Then

I can't understnad why it is working for you in some instances.
 
K

KosLooney

Thx Steve, it works perfect now :D

KosLooney



Kos,

You should use # rather than " as the delimiter for time values. For
example...
If Time < #9:30# Or Time > #10:50# Then

I can't understnad why it is working for you in some instances.
 

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

Top