Time Issue

G

Guest

I'm having an issue with TIME. I'm checking the time and, if it's after 2:00
p.m., I want to set a control on a form to tomorrow (next day).

It's wierd, but if the form is used BEFORE 10:00 a.m, the control is set to
tomorrow's date. I only want it to set it to tomorrow's date if it's AFTER
2:00 p.m.

The code:

++++++++++++++++

'Check Time
If Time > "14:00:00" Then

'AFTER Cut-Off Time , Set field Date = Tomorrow

Me.field = Date + 1

'End Check Time
End If

++++++++++++++++

Any help that you can provide is welcome. Thanks, in advance, for your
assistance.

G
 
S

strive4peace

Hi G,

you are comparing a time to a string... try this:

If Time > TimeValue("14:00:00") Then

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
J

John Vinson

'Check Time
If Time > "14:00:00" Then

Time and date values are NOT strings - they're stored as numbers. To
use a literal time criterion, try

If Time > #14:00:00# Then



John W. Vinson[MVP]
 

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