Algo menos elaborado, pero mas sencillo si sos novato es:
Código Delphi
[-]
Function TForm1.ValidarDatos : Boolean;
Var
s : Mensaje;
Begin
s := '';
if Trim(EditNombre.Text) = '' Then
s := s + '[Nombre] ';
if Trim(EditApellido.Text) = '' Then
s := s + '[Apellido] ';
....
if s <> '' Then
ShowMessage('Error: Debe rellenar los siguientes campos: ' + s);
result := s = '';
end;
Procedure TForm1.BtnGrabarClick(Sender : TObject);
Begin
if ValidarDatos Then
Graba;
end;
Hasta luego.