Solved

First,Edit,Next and Post ....

Posted on 2000-02-22
6
150 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now