Conditions

Chimp8471

Registered User.
Local time
Today, 14:20
Joined
Mar 18, 2003
Messages
353
I am trying to set a few conditions on a form that i have but really don't know how to sort this problem out.

I have four fields

(1) Time In
(2) Sample In
(3) Sample Out
(4) Time Out

this reflects the times that certain activities take place, for example time in refers to the time that the lorry arrives on site, Sample in is the time that the sample is taken from the lorry, sample out is the time that the sample has been checked and passed ok, Time out is the time that the lorry leaves our site.

I need to set up some kind of rule so that the above is entered in the correct order, and so that thetimes can't be before the previous activities time, so it wouldn't be possible to have an out time before the in time.

i really have no idea where or how to go about this

Please Help

Andy
 
In the afterupdate event of each you can check on the currentvalue beeing greater than the previous

if me.[Time in] > me.[Sample In] then
msgbox "No good"
endif

Just 1 more thing tho: Dont use spaces in names ... Its "Not done" and will come around to hurt you some day...

Regads

The Mailman
 
Many Thanks will give it a go
 
the code works great but when i click ok on the messgae box it goes on to the next box, ideaaly i would like it to remain in the current box untill the correct data has been entered.

Can this be done please, if so how ??

Andy
 
That's possible. Best for validating is using the BeforeUpdate-event. Then you say:
Code:
if me.[Time in] > me.[Sample In] then 
  MsgBox "No good" 
  Cancel = True
End If
 

Users who are viewing this thread

Back
Top Bottom