Erro Operator not applicable to this operand type Berlin 10.1

13/06/2022

0

Olá a todos

Bom é estou produzindo uma tela de lançamento de item (ou movimento)

Tenho lá os edCod, edDescricao, edValor, edQtd, edTotal

No button salvar faço a verificação deles

>>
procedure TFLanItem.btSalvarClick(Sender: TObject);
begin

if edCod.Text='' '' then
begin
ShowMessage(''CÓDIGO DO PRODUTO NÃO INFORMADO'');
edCod.SetFocus;
Exit
end;

if edDescricao.Text='' '' then
begin
ShowMessage(''DESCRIÇÃO DO PRODUTO NÃO INFORMADO'');
edDescricao.SetFocus;
Exit
end;

if edQtd.Text='' '' then
begin
ShowMessage(''QUANTIDADE DO PRODUTO NÃO INFORMADO'');
edQtd.SetFocus;
Exit
end;

if edValor.Text='' '' then
begin
ShowMessage(''VALOR DO PRODUTO NÃO INFORMADO'');
edValor.SetFocus;
Exit
end;

if edTotal.Text='' '' then
begin
ShowMessage(''TOTAL DO PRODUTO NÃO INFORMADO'');
edTotal.SetFocus;
Exit
end;

Até aqui está tudo bem ele faz a verificação bonitinho

aí vem o gerador dele
if not dm.cItens.State=dsInsert then >> onde está dando o erro << Operator not applicable to this operand type
begin
dm.cItens.Append;
dm.qryGenIdItem.Close;
dm.qryGenIdItem.Open;
dm.cItensID_ITEM.AsInteger:=dm.qryGenIdItemID.AsInteger;
end;
João

João

Responder

Posts

13/06/2022

Emerson Nascimento

procedure TFLanItem.btSalvarClick(Sender: TObject);
begin
	if edCod.Text=' ' then
	begin
		ShowMessage('CÓDIGO DO PRODUTO NÃO INFORMADO');
		edCod.SetFocus;
		Exit
	end;

	if edDescricao.Text=' ' then
	begin
		ShowMessage('DESCRIÇÃO DO PRODUTO NÃO INFORMADO');
		edDescricao.SetFocus;
		Exit
	end;

	if edQtd.Text=' ' then
	begin
		ShowMessage('QUANTIDADE DO PRODUTO NÃO INFORMADO');
		edQtd.SetFocus;
		Exit
	end;

	if edValor.Text=' ' then
	begin
		ShowMessage('VALOR DO PRODUTO NÃO INFORMADO');
		edValor.SetFocus;
		Exit
	end;

	if edTotal.Text=' ' then
	begin
		ShowMessage('TOTAL DO PRODUTO NÃO INFORMADO');
		edTotal.SetFocus;
		Exit
	end;

	if not (dm.cItens.State in [dsInsert]) then
	begin
		dm.cItens.Append;
		dm.qryGenIdItem.Close;
		dm.qryGenIdItem.Open;
		dm.cItensID_ITEM.AsInteger:=dm.qryGenIdItemID.AsInteger;
	end;
end;
Responder

13/06/2022

João

procedure TFLanItem.btSalvarClick(Sender: TObject);
begin
	if edCod.Text=' ' then
	begin
		ShowMessage('CÓDIGO DO PRODUTO NÃO INFORMADO');
		edCod.SetFocus;
		Exit
	end;

	if edDescricao.Text=' ' then
	begin
		ShowMessage('DESCRIÇÃO DO PRODUTO NÃO INFORMADO');
		edDescricao.SetFocus;
		Exit
	end;

	if edQtd.Text=' ' then
	begin
		ShowMessage('QUANTIDADE DO PRODUTO NÃO INFORMADO');
		edQtd.SetFocus;
		Exit
	end;

	if edValor.Text=' ' then
	begin
		ShowMessage('VALOR DO PRODUTO NÃO INFORMADO');
		edValor.SetFocus;
		Exit
	end;

	if edTotal.Text=' ' then
	begin
		ShowMessage('TOTAL DO PRODUTO NÃO INFORMADO');
		edTotal.SetFocus;
		Exit
	end;

	if not (dm.cItens.State in [dsInsert]) then
	begin
		dm.cItens.Append;
		dm.qryGenIdItem.Close;
		dm.qryGenIdItem.Open;
		dm.cItensID_ITEM.AsInteger:=dm.qryGenIdItemID.AsInteger;
	end;
end;


Opa Muito obrigado!! é que ainda sou novato neste mundo da programação tanto que estou fazendo um curso, muito obrigado
Responder

Que tal ter acesso a um e-book gratuito que vai te ajudar muito nesse momento decisivo?

Ver ebook

Recomendado pra quem ainda não iniciou o estudos.

Eu quero
Ver ebook

Recomendado para quem está passando por dificuldades nessa etapa inicial

Eu quero

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar