Jump to content
Fórum Script Brasil
  • 0

como executar esse codigo


vms

Question

ola pessoal

consegui esse codigo aqui no forum

serve para numerar os campos da tabela

Events

OnCalcFilds

DataModule1.Tabela1campo.Value := DataModule1.Tabela1.RecNo;

a duvida é o seguite:

é possivel execultar esse codigo atravez de um button?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
é possivel execultar esse codigo atravez de um button?

procedure TForm1.Button1Click(Sender: TObject);
var i : integer;
begin
   for i := 1 to DataModule1.Tabela1.recordcount do
      begin
                                 DataModule1.Tabela1.Edit;
         DataModule1.Tabela1campo.Value := i;
         DataModule1.Tabela1.Post;
                                 DataModule1.Tabela1.Next;

      end;

  
end;

OBS: OnCalcFilds não pode ser alterado, este codigo é para renumerar um campo da tabela

abraço

Edited by Jhonas
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152k
    • Total Posts
      651.6k
×
×
  • Create New...