Use the form's BeforeUpdate event to test the conditions:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Len(Me.[Time Out].Value & "") = 0 Then
MsgBox "You must enter a value for the Time Out data!"
Cancel = True
ElseIf Len(Me.[Time In].Value & "") = 0 Then
MsgBox "You must enter a value for the Time In data!"
Cancel = True
ElseIf DateDiff("s", Me.[Time Out].Value, Me.[Time In].Value) > 0 Then
MsgBox "Time Out value is earlier than Time In value!"
Cancel = True
End If
End Sub

Signature
Ken Snell
<MS ACCESS MVP>
>I have a form in which we enter the time in (set as Medium Time) and time
>out
[quoted text clipped - 5 lines]
> being
> made?
>I have a form in which we enter the time in (set as Medium Time) and time out
>(set as Medium Time) and then another box I have a formula (=[Time Out]-[Time
>In]) which shows the time spent. Is there a way to have an error window pop
>up if the time out is before the time in? Or someway to stop an entry being
>made?
Does your field contain just a time, or a date and time? Will you ever have
the situation where the TimeIn is 11:50pm and the TimeOut 2:30am? If so you
may want to consider using both the date and time, not just the time.
That said... in your Form's BeforeUpdate event you can click the ... icon,
choose Code Builder, and edit the code to:
Private Sub Form_BeforeUpdate(Cancel as Integer)
If [Time In] > [Time Out] Then
MsgBox "You can't finish before you start!!!"
Cancel = True
Me![Time Out].SetFocus
End If
End Sub
John W. Vinson [MVP]
Joy - 10 Dec 2007 19:57 GMT
I must be doing something wrong because I can't get either of these to work.
I only use time. Date is not an issue. Can you offer some more advice?

Signature
Thanks, Joy
> >I have a form in which we enter the time in (set as Medium Time) and time out
> >(set as Medium Time) and then another box I have a formula (=[Time Out]-[Time
[quoted text clipped - 18 lines]
>
> John W. Vinson [MVP]
Ken Snell (MVP) - 11 Dec 2007 03:31 GMT
Tell us how you set up the approaches/code, and what happens when you "run"
the code. Also, show us some examples of data that, when entered, should
produce the error that you want to bring to the user's attention.

Signature
Ken Snell
<MS ACCESS MVP>
>I must be doing something wrong because I can't get either of these to
>work.
[quoted text clipped - 29 lines]
>>
>> John W. Vinson [MVP]