Board index » delphi » Dataset not in Edit or Insert mode

Dataset not in Edit or Insert mode

Problem 3:
 To update the summary table, I use the code:

  with dm.tblZInvHist do begin  //  ERROR HERE 'not in edit or insert
mode'
    Open;
    FieldValues['GST']:=      GST;
    FieldValues['PST']:=      PST;
    FieldValues['SubTotal']:= SubTotal;
    FieldValues['Disc']:=     Discount;
    FieldValues['Taxes']:=    Taxes;
    FieldValues['InvTotal']:= Total;
  end;

However, I get the error message:
 tblZInvHist: Dataset not in edit or insert mode.
This despite the fact that I have just appended a new record and
successfully entered information into several fields. I can find nothing
in my code that would set the table to disallow editing.

Please give me some suggestions for this problem.

 

Re:Dataset not in Edit or Insert mode


Peter,

Add the line
    Edit;
just after Open.
Just before end : add the line
    Post.

Success,
Alfred.

Peter Reid <pwr...@dowco.com> schreef in berichtnieuws
3840E18F.5D13B...@dowco.com...

Quote
> Problem 3:
>  To update the summary table, I use the code:

>   with dm.tblZInvHist do begin  //  ERROR HERE 'not in edit or insert
> mode'
>     Open;
>     FieldValues['GST']:=      GST;
>     FieldValues['PST']:=      PST;
>     FieldValues['SubTotal']:= SubTotal;
>     FieldValues['Disc']:=     Discount;
>     FieldValues['Taxes']:=    Taxes;
>     FieldValues['InvTotal']:= Total;
>   end;

> However, I get the error message:
>  tblZInvHist: Dataset not in edit or insert mode.
> This despite the fact that I have just appended a new record and
> successfully entered information into several fields. I can find nothing
> in my code that would set the table to disallow editing.

> Please give me some suggestions for this problem.

Re:Dataset not in Edit or Insert mode


Thanks, Alfred - that solved the problem! - Peter Reid.
Quote
Alfred ten Hoeve wrote:
> Peter,

> Add the line
>     Edit;
> just after Open.
> Just before end : add the line
>     Post.

> Success,
> Alfred.

> Peter Reid <pwr...@dowco.com> schreef in berichtnieuws
> 3840E18F.5D13B...@dowco.com...
> > Problem 3:
> >  To update the summary table, I use the code:

> >   with dm.tblZInvHist do begin  //  ERROR HERE 'not in edit or insert
> > mode'
> >     Open;
> >     FieldValues['GST']:=      GST;
> >     FieldValues['PST']:=      PST;
> >     FieldValues['SubTotal']:= SubTotal;
> >     FieldValues['Disc']:=     Discount;
> >     FieldValues['Taxes']:=    Taxes;
> >     FieldValues['InvTotal']:= Total;
> >   end;

> > However, I get the error message:
> >  tblZInvHist: Dataset not in edit or insert mode.
> > This despite the fact that I have just appended a new record and
> > successfully entered information into several fields. I can find nothing
> > in my code that would set the table to disallow editing.

> > Please give me some suggestions for this problem.

Other Threads