Solved

Master-Detail

Posted on 2002-07-22
9
250 Views
Last Modified: 2010-04-04
To design a data entry form including Master-Detail tables
what should be done no to encounter  the folloeing errors:
  1- Data set is not insert or edit mode
  2- Data set is Read only
Thanks
0
Comment
Question by:fhbexpir
[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
9 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 20 total points
ID: 7170008
1- Data set is not insert or edit mode

use dataset.edit before begin editing

2- Data set is Read only

use a not read only dataset


maybe you should be more concrete

meikl ;-)
0
 
LVL 3

Expert Comment

by:marcoszorrilla
ID: 7170507
You need a master record before inserting a detail record.
MiMaster.Append;
MiMasterCustomerCod.Value:='XXXXXXX';
MiDetail.Append;
MiDetail.BlaBla.Value:='SSSSSS';

Best Regards.
Marcos.
0
 

Assisted Solution

by:kiranramesh
kiranramesh earned 20 total points
ID: 7171289
Hi fhbexpir,

put break point and check where the error is coming.
You must be assigning a value to the table.field without editing the table.

For ex: table.col := 1;
it should be
table.edit;
table.col := 1;
table.post;

Try out, you can do it.

Regards
Kiran.
0
Technology Partners: 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!

 

Author Comment

by:fhbexpir
ID: 7175481
the table is in edit or indert mode and isn't Readonly
0
 

Expert Comment

by:kiranramesh
ID: 7176529
Hi fhbexpir,

See In delphi if you set master detail it does not automatically set the detail table in insert or edit mode when you put the master in insert or edit mode.
You have to manually code for that.

Else there is a option in the data source component which you link to table called as AUTO EDIT. Set it to true, it should solve your problem. But this is not advisable.

But practically you should control the detail only on master.
I mean to say that only if master is in insert or edit allow the detail to be edited.

If (master.state in [dsEdit,dsInsert]) Then
  Detail.Edit;

Good Luck
Kiran
0
 

Expert Comment

by:kiranramesh
ID: 7176536
Oops I almost forgot,

Please use cached updates to avoid unplesent messages.
For example if you try to post detail first before master while inserting it will give u a message that master record is missing.

Regards,
Kiran.
0
 
LVL 2

Expert Comment

by:ferhad
ID: 7211937
1.Call Edit or Insert method of TTable (Table1.Edit)
2.Dont use ReadOnly Dataset
0
 

Expert Comment

by:CleanupPing
ID: 9343015
fhbexpir:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 9461400
fhbexpir,
No comment has been added lately (18 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: split points between kretzschmar http:#7170008 and kiranramesh http:#7176529

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

anAKiN
EE Cleanup Volunteer
0

Featured Post

Technology Partners: 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

Suggested Solutions

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…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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