try this code
Code:
MTLanca.Refresh;
if MTLanca.BookmarkValid(AtualRec) then
MTLanca.GotoBookmark(AtualRec);
and you can use MTLanca.RecNo like this
Code:
procedure TDFM_Conciliacao.CalcularSaldo;
var
qsaldo : Currency;
qDia : TDateTime;
AtualRec : Integer;
begin
// Check if table is empty then Exit.
If MTLanca.IsEmpty then
begin
ShowMessage('Table is Empty');
Exit;
end;
// Exclui saldos anteriores...
AtualRec := MTLanca.RecNo;
MTLanca.DisableControls;
MTLanca.Filtered := False;
MTLanca.First;
while not MTLanca.Eof do
begin
if MTLancaStatus.Value = 4 then
MTLanca.Delete;
MTLanca.Next;
end;
MTLanca.Refrech;
if AtualRec < MTLanca.RecordCount then
MTLanca.RecNo := AtualRec
else MTLanca.Last;
Note: you don't need to use ELSE if you delete record or not you need to move to next record to check it.
I hope this will help you.. feel free to ask if you need more help.