Re: Problem with Master/Detail tables
- From: Brian Bushay TeamB <BBushay@xxxxxxxxx>
- Date: Wed, 26 Mar 2008 21:27:53 -0500
In the OnChange event of the two fields that make the PrimaryKey in the
master table I put the following code:
ADODatasetDetail.Refresh;
But also in this case the record disappear from the detail grid if I change
the value of Date or Time.
Even if I put code in the above event to close and open again the detail
dataset I got the same result.
The only way is to close the application.
One solution could be adding an AutoInc field in the master table as primary
key and use that field to build the master/detail relation.
This field could not be change and in this way I solve the problem.
Then I could programatically check if the user is trying to post a master
record with and existing date and time (what is now controlled automatically
as they are the primary key). But I would like this to be the last option.
Any suggestion?
I recommended Requery not Refresh and putting code in the Onchange event won't
do you any good since the changes only take place after the master record has
posted.
Try using the master table AfterPost event and using as code
DetailTable.Requery;
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.
- Follow-Ups:
- Re: Problem with Master/Detail tables
- From: Alverio
- Re: Problem with Master/Detail tables
- References:
- Problem with Master/Detail tables
- From: Alverio
- Re: Problem with Master/Detail tables
- From: Brian Bushay TeamB
- Re: Problem with Master/Detail tables
- From: Alverio
- Problem with Master/Detail tables
- Prev by Date: about dbgrideh's checkBox
- Next by Date: Re: Problem with Master/Detail tables
- Previous by thread: Re: Problem with Master/Detail tables
- Next by thread: Re: Problem with Master/Detail tables
- Index(es):
Relevant Pages
|