Re: Problem with Master/Detail tables
- From: "Alverio" <alverio.m@xxxxxxxxxx>
- Date: Thu, 27 Mar 2008 07:01:21 +0100
Thanks a lot, Brian. Now it works properly. I don't why I used Refresh
instead of Requery...
But in any case I put code in the wrong event!
Ciao,
Alverio
"Brian Bushay TeamB" <BBushay@xxxxxxxxx> ha scritto nel messaggio
news:s71mu3tqphneppkumro4c0bd2e1s6mccki@xxxxxxxxxx
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
.
- 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
- Re: Problem with Master/Detail tables
- From: Brian Bushay TeamB
- Problem with Master/Detail tables
- Prev by Date: Re: Problem with Master/Detail tables
- Next by Date: Re: List availalbe SQL Servers?
- Previous by thread: Re: Problem with Master/Detail tables
- Next by thread: TADOStoreproc
- Index(es):
Relevant Pages
|