Esse é o código do botão Salvar do meu formulário de cadastro de boletos...
procedure TfrmCadBoleto.btnSalvarClick(Sender: TObject); begin if dbEmpresa.text='' then begin SHOWMESSAGE ('CAMPO EMPRESA ESTÁ VAZIO'); end; if dbESCOLA.text='' then begin SHOWMESSAGE ('CAMPO ESCOLA ESTÁ VAZIO'); end; if dbCONTA.text='' then begin SHOWMESSAGE ('CAMPO CONTA ESTÁ VAZIO'); end; if dbCLIENTE.text='' then begin SHOWMESSAGE ('CAMPO CLIENTE ESTÁ VAZIO'); end; if dbRGCPF.text='' then begin sHOWMESSAGE ('CAMPO CAMPO RG/CPF ESTÁ VAZIO'); end; if dbBOLETO.text='' then begin SHOWMESSAGE ('CAMPO BOLETO ESTÁ VAZIO'); end; if dbVALOR.text='' then begin SHOWMESSAGE ('CAMPO VALOR ESTÁ VAZIO'); end; if dbSITUACAO.text='' then begin SHOWMESSAGE ('CAMPO SITUACAO ESTÁ VAZIO'); end; if dbDATA.text='' then begin SHOWMESSAGE ('CAMPO DATA VENCIMENTO ESTÁ VAZIO'); end; begin dmData.tblCobTilt.post; btnSalvar.enabled:=false; dbEmpresa.enabled:=false; dbEscola.enabled:=false; dbConta.enabled:=false; dbCliente.enabled:=false; dbRGCPF.enabled:=false; dbBoleto.enabled:=false; dbData.enabled:=false; dbValor.enabled:=false; dbSituacao.enabled:=false; dbJuros.enabled:=false; ShowMessage('Boleto Salvo com Sucesso') end; end;
E o erro é que ele naum respeita os IFs, ele simplesmente passa por tudo e salva..
e eu quero que:
se tiver um campo em branco, naum importa qual... o projeto naum salve o registro...
alguem poderia me ajudar??
Grato
Nelson