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

Dataset not in Edit or Insert mode - D3

I am using Delphi 3.  I have a form with a master record and a DBGrid on the
same form with the child.  When I try to edit data in the grid, the data
will edit - but when I hit TAB (or try to create a new record), I get the
error "Dataset not in Edit or Insert mode".  On checking the state at this
point, the dataset is in dsBrowse mode.

AutoEdit for the dataset is true.
I have tried dataset.Append, and then when I check the state for
OnNewRecord, the dataset is set to dsBrowse.

What is going on?

I have another grid on another form that works well, but is just updating
lookup tables - i.e.: No Master / Child relationship, just straight data
entry into a single table.

I don't know if it makes a difference, but there are two Lookup fields on
the grid that fails, but these are set at design time, so I do not know why
it would have a bearing on this problem.

Any help would be appreciated.

Chrism

 

Re:Dataset not in Edit or Insert mode - D3


Quote
Chrism wrote in message <3a73fb55_2@dnews>...
>I am using Delphi 3.  I have a form with a master record and a DBGrid
on the
>same form with the child.  When I try to edit data in the grid, the
data
>will edit - but when I hit TAB (or try to create a new record), I get
the
>error "Dataset not in Edit or Insert mode".  On checking the state at
this
>point, the dataset is in dsBrowse mode.

If focus is on a DBGrid, and you exit that DBGrid before adding data to
any fields, the default action is to cancel the edit or insert.

If that is not the problem then you have code somewhere that is causing
it to move off the new or edited record without posting, perhaps in the
OnExit event of some control.

--
Happy New Millenium!
Wayne Niddery (WinWright Inc.)
RADBooks - http://members.home.net/wniddery/
"No matter what happens, somebody will find a way to take it too
seriously" - Dave Barry

Re:Dataset not in Edit or Insert mode - D3


On Sun, 28 Jan 2001 11:45:27 -0500, "Wayne Niddery (TeamB)"

Quote
<winwri...@chaffhome.com> wrote:
>>>same form with the child.  When I try to edit data in the grid, the
>>data

Check that you have AutoCalcFields:=False for the TTable associated
with the grid.DataSource.

--

Gary C.

Re:Dataset not in Edit or Insert mode - D3


Either something in your code is calling Post or Cancel or something in your
code is moving to a different record which implicitly calls post.

--
Bill

Other Threads