Please Help Me

TheOx2K

Registered User.
Local time
Today, 02:17
Joined
Feb 19, 2002
Messages
28
I have a form that has the time on it updated with simple code on the ontimer event. What i want is for some code to return a certain value depending on what the time is. So for example if the time is between 12:00 noon and 1pm id like to value to come back as "lunch".
 
So create another text box that will show the "lunch" or "break" description. Place code behind the After Update event of your time field...

Be sure to confirm how the time is being stored in your field so you get the syntax right on your Select Case statement. Also look up Select Case under help to get the syntax correct on comparing values in the field.

Sub txtTimeField after_update

dim txtTimeDescription as string

select case me.YourTimeField

Case Between "1200" and "100"

txtTimeDescription = "Lunch"

Case > 5:00
txtTimeDescription = "Overtime"

Case < 8:00
txtTimeDescription = "What are they doing here so early?"

end select

etc etc.

Hope this gets you on the right track.

EB




[This message has been edited by Elana (edited 04-07-2002).]
 

Users who are viewing this thread

Back
Top Bottom