procedure TForm1.FormShow(Sender: TObject);
begin
LongTimeFormat:= 'hh:mm:ss';
DataSet1.FieldByName('HORA').EditMask:= '!90:00:00;1;_';
...
end;
procedure TForm1.DataSet1HORASetText(Sender: TField; const Text: String);
var
Hora,m1,m2,
t1,t2: TTime;
aux: string;
begin
aux:= Text;
m1:= StrToTime('08:00');
m2:= StrToTime('12:00');
t1:= StrToTime('16:00');
t2:= StrToTime('20:00');
Hora:= StrToTime(aux);
DataSet1.Edit;
if ((ComboBox1.Text = 'MAÑANA') and
((Hora < m1) or ( Hora > m2))) or
((ComboBox1.Text = 'TARDE') and
((Hora < t1) or (Hora > t2))) then
begin
ShowMessage('Horario no permitido en el turno elegido');
DataSet1.Cancel;
end
else
(Sender as TField).AsDateTime:= Hora;
end;