Solved

First,Edit,Next and Post ....

Posted on 2000-02-22
6
155 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

737 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