Hi Allan,
I needed to do something like this.. There are a couple of ways to do it.
One way is to add a calculated column in the query for the form.
Shift: IIF( [End] - [Start] = 0,"Day Off",IIF([Start]=0700 AND
[End]=1500,"Early","OOPS" )
Another way is to write a function. In an empty column in the query, enter:
Shift: GetShift([Start],[End])
The function would look something like:
'**** UNTESTED************
Function GetShift(pStart As Date, pEnd As Date) As String
If pStart = 0700 And pEnd = 0700 Then
GetShift = "Day Off"
ElseIf pStart = 0700 And pEnd = 1500 Then
GetShift = "Early"
Else
GetShift = "OOPS"
End IF
End Function
'********************
With the function, it is easier to add many more tests.
With either way, on the form, add a text box and set the control source to
the field "Shift" (or what ever name you named it). BTW, this works in
reports also..
HTH

Signature
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)
> Hello
>
[quoted text clipped - 14 lines]
>
> Many Thanks as always
Jan Baird - 27 May 2008 20:51 GMT
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.