Erro ao alterar estado do SpeedButton
Quando chamo a procedure ele da um erro de Access Violation e pára nesta linha da procedure: SpInclui.Enabled := True;
Estou fazendo a chamada dela assim:
with DmEstoque do Procedures.Botoes(fCadCFOP, IbDEstCfop);
Procedure TProcedures.Botoes(nForm : TForm; nTabela : TIBDataSet);
begin
With DmEstoque do begin
With nForm do begin
if nTabela.state = dsInactive then begin
SpInclui.Enabled := True;
SpGrava.Enabled := False;
SpCancela.Enabled := False;
SpExclui.Enabled := False;
SpLocaliza.Enabled := True;
end;
if nTabela.state = dsInsert then begin
SpInclui.Enabled := False;
SpGrava.Enabled := True;
SpCancela.Enabled := True;
SpExclui.Enabled := False;
SpLocaliza.Enabled := False;
end;
end
end;
end;
Desde já Obrigado. :?: :?:
Estou fazendo a chamada dela assim:
with DmEstoque do Procedures.Botoes(fCadCFOP, IbDEstCfop);
Procedure TProcedures.Botoes(nForm : TForm; nTabela : TIBDataSet);
begin
With DmEstoque do begin
With nForm do begin
if nTabela.state = dsInactive then begin
SpInclui.Enabled := True;
SpGrava.Enabled := False;
SpCancela.Enabled := False;
SpExclui.Enabled := False;
SpLocaliza.Enabled := True;
end;
if nTabela.state = dsInsert then begin
SpInclui.Enabled := False;
SpGrava.Enabled := True;
SpCancela.Enabled := True;
SpExclui.Enabled := False;
SpLocaliza.Enabled := False;
end;
end
end;
end;
Desde já Obrigado. :?: :?:
Andregeraldo
Curtidas 0
Respostas
Jocelio
21/04/2005
Olá amigo, verifique se DmEstoque ou nForm foram criados antes de chamar a Procedure TProcedures.Botoes(nForm : TForm; nTabela : TIBDataSet);
Espero que ajude. JOcelio :-)
Espero que ajude. JOcelio :-)
GOSTEI 0
Yallebr
21/04/2005
if Assigned (Formulario) then
begin
....
.... Codigo.
..
end;
Isso possivelmente resolve.
begin
....
.... Codigo.
..
end;
Isso possivelmente resolve.
GOSTEI 0