Solved

First,Edit,Next and Post ....

Posted on 2000-02-22
6
149 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

762 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

18 Experts available now in Live!

Get 1:1 Help Now