Board index » delphi » not in edit mode problem.

not in edit mode problem.

Quote
>My question is: What's actually going on here? How does Delphi put tables
>into autoedit mode? This field is not auto-editing, and it seems that it is
>because
>I am testing the key pressed in this field.

AutoEdit mode puts the table in Edit when the user begins to enter data into a
data aware control.   Since you are changing the data in code you need to set
Edit in your code.
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com
 

Re:not in edit mode problem.


Hi there,
(Paradox 7, BDE 5.11, D5)

I have a grid, which is connected to the detail in master-detail relation.
The master src
has the auto-edit to false, the detail src has autoedit set to true.

One field on the grid can only have PTI or QUOTE as valid entries, so
I capture the key press event of the grid, determine whether they are
in the correct column, and if so only allow a P or Q to be pressed and I
update the field value underneath. My problem is that when a user goes
back to a previously inserted record, and tries to change the QUOTE to
PTI, (or vice-versa) an error occurs informing that the dataset is not in
edit
mode. If the user changes any of the other fields in the grid, there is no
error
and the user can then go on and change the P/Q filed in question.

My question is: What's actually going on here? How does Delphi put tables
into autoedit mode? This field is not auto-editing, and it seems that it is
because
I am testing the key pressed in this field.

I don't know if I've made my question too cryptic by waffling on too much,
but if someone does know what I'm on about.... any ideas?

Regards,
-Ryan

Re:not in edit mode problem.


Quote
> AutoEdit mode puts the table in Edit when the user begins to enter data
into a
> data aware control.   Since you are changing the data in code you need to
set
> Edit in your code.

Thanks Brian, for this info. I was pretty sure that was the case, just
wanted to make sure I understood it.

With my master-detail forms, I have the auto-edit to false for the master,
but I leave the detail tables with their auto-edit to true because I haven't
found a reliable way to toggle
the detail table mode in time with the master.

Is it better to have both master and detail NOT in auto-edit mode and
control both tables
when adding / editing a record?
If so, what is the best method of toggling both tables?

Regards,
-Ryan

Re:not in edit mode problem.


You can change the datasource of the navigation
bar to toggle
around with the tables thru a code.

"Ryan Nilsson-Harding" <nils...@one.net.au> wrote
in message news:3a0639c8_1@dnews...

Quote
> AutoEdit mode puts the table in Edit when the

user begins to enter data
into a
Quote
> data aware control.   Since you are changing the

data in code you need to
set

Quote
> Edit in your code.

Thanks Brian, for this info. I was pretty sure
that was the case, just
wanted to make sure I understood it.

With my master-detail forms, I have the auto-edit
to false for the master,
but I leave the detail tables with their auto-edit
to true because I haven't
found a reliable way to toggle
the detail table mode in time with the master.

Is it better to have both master and detail NOT in
auto-edit mode and
control both tables
when adding / editing a record?
If so, what is the best method of toggling both
tables?

Regards,
-Ryan

Re:not in edit mode problem.


Quote
>Is it better to have both master and detail NOT in auto-edit mode and
>control both tables
>when adding / editing a record?
>If so, what is the best method of toggling both tables?

I think this is just a matter of personal preference.  I usually leave AutoEdit
set to true for all my tables.  If I need to keep a user from editing a table I
will do it by raising an error in the BeforeEdit and BeforeInsert methods.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:not in edit mode problem.


Quote
> You can change the datasource of the navigation
> bar to toggle
> around with the tables thru a code.

Murtaza, can you clarify this point for me?
A suggestion perhaps on how to do this?

-Ryan

Other Threads