Syntax for code

spacepro

Registered User.
Local time
Today, 23:02
Joined
Jan 13, 2003
Messages
714
Hi All,

I'm very tired and this is probably stating the obvious but I want to assign a value if the time is between 6am and 2pm. What is the syntax in VBA?
Code:
if time = >#06:00# or <#14:00# Then
'assign value here
end if

Not quite there. Anyone help, gone a bit rusty.

Thanks

Andy
 
How about:

if time = >#06:00# and Time <#14:00# Then
'assign value here
end if

Greetz
 
Is there a date as part of this field?
 
I assumed he was using the Access function Time....
 
You both have your mathematical operators wrong:

Greater than or equal to is >= and not =>

Code:
if time >= #06:00:00# and Time < #14:00:00# Then
    'assign value here
end if
 
Thanks namliam,

I knew it was something like that :D

Yes I am using the time function.


The artist formerly known as Mile-O,
I know it was 1am when I wrote the post.

Thanks

Andy
 
SJ McAbney said:
You both have your mathematical operators wrong:

Greater than or equal to is >= and not =>
I just took his example, didnt look at much else...
 

Users who are viewing this thread

Back
Top Bottom