Subject | Problems with EOF |
---|---|
Author | petesouthwest |
Post date | 2005-11-07T21:33:05Z |
Hi
I have a procedure below, that I thought should loop through a group
of records and update a couple of fields. However, it will do the
first record only, never seeming to execute the 'next'. I'm obvioulsy
mis-understood the function of something, but cant work out what! If
someone could point out the error in my understanding I would be very
gratefull! :)
Thanks for any help given.
Pete
procedure tform1.closeCorrespondence;
begin
qryFollowUpEmails.FetchAll;
qryFollowUpEmails.first;
qryFollowUpEmails.requestlive:=true;
qryFollowUpEmails.open;
qryFollowUpEmails. edit;
while not qryFollowUpEmails.Eof do
begin
with qryFollowUpEmails do
begin
fieldbyname('correspondencedate').value:=now();
Fieldbyname('status').AsString:='closed';
end;
next;
end;
qryFollowUpEmails.post;
end;
I have a procedure below, that I thought should loop through a group
of records and update a couple of fields. However, it will do the
first record only, never seeming to execute the 'next'. I'm obvioulsy
mis-understood the function of something, but cant work out what! If
someone could point out the error in my understanding I would be very
gratefull! :)
Thanks for any help given.
Pete
procedure tform1.closeCorrespondence;
begin
qryFollowUpEmails.FetchAll;
qryFollowUpEmails.first;
qryFollowUpEmails.requestlive:=true;
qryFollowUpEmails.open;
qryFollowUpEmails. edit;
while not qryFollowUpEmails.Eof do
begin
with qryFollowUpEmails do
begin
fieldbyname('correspondencedate').value:=now();
Fieldbyname('status').AsString:='closed';
end;
next;
end;
qryFollowUpEmails.post;
end;