Solved

First,Edit,Next and Post ....

Posted on 2000-02-22
6
154 Views
Last Modified: 2010-04-04
is it Ok?

with Form1.TablaPersonal Do
begin
    First;
       while not Eof Do
       begin
            Edit;
            Form1.TablaPersonalDias.Value:=Form1.TablaPersonalDias.Value+45;
            Post;
            Next;
       end;
end;
0
Comment
Question by:chiro
6 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 2546786
at first sight, yes... why not?

If it is a calculated field you better place it in the OnCalcFields event.

Zif
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2546794
you could also use :

Edit;
FieldByName('Dias').AsInteger := FieldByName('Dias').AsInteger + 45;
Post;

Or AsFloat if you're working with float's..

Zif.
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2546801
Err no actually.

You've defined a WITH for Form1.TablaPersonal and this is what you're first, next, EOF etc. are acting on. You then try to do some modification on Form1.TablaPersonalDias but this ISN'T being placed into edit mode, posted etc.

The Neil
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Expert Comment

by:ZifNab
ID: 2546810
:-) since you're working with Dates... I suppose AsDateTime or AsDate would be better in the example code (then AsInteger)

Zif.
0
 

Expert Comment

by:manjushan
ID: 2549284
Hi,
  It look perfect.Provided u open ur table before that.And you have not set the fields ro read only.
        Gook luck.
                  Manju.
0
 

Accepted Solution

by:
Pandian012000 earned 100 total points
ID: 2549310
Hi chiro

I can suggest one more method to do it

place a query component ( eg. qry_update)

In the sql string write the following

update <Table name> set <fieldname> = <field name>+45

then you can execute this query

( qry_update.execsql)

I hope this will work for you

Regards

Pandian
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Internet Explorer View Settings Question 15 122
tidtcpserver connection lost handle 2 110
Delphi Seattle StructureView color 1 21
Using MMsystem To change audio input 1 17
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question