Re: Problem with Master/Detail tables



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


.



Relevant Pages

  • RE: Table as Criteria
    ... Brian, I found my answer. ... pick one table to be used as the master. ... >>> Run an update query for the master table to update its MonthID entry to ... >>> field entry for MasterID. ...
    (microsoft.public.access.queries)
  • Re: ADO Connection Delete Problem - Referential Integrity Reversed!!
    ... OK Brian, it is as I suspected, but I still don't understand why. ... >>(master) row in the referenced table. ... >>would raise a FK violation error. ... > What error would you give when you are trying to delete a foreign key ...
    (borland.public.delphi.database.ado)
  • Hi all. Not really a newbie, but ..
    ... brian.. ... john.. ... master ... ... linny.. ...
    (alt.guitar.bass)
  • Re: Hi all. Not really a newbie, but ..
    ... brian.. ... john.. ... master ... ... Same band in a jazz funk style. ...
    (alt.guitar.bass)
  • Re: usage of clientdataset with jet
    ... Thanks Brian, you are right. ... I will look into narrowing ... >>only one record for every record in the master table. ... > master data fields. ...
    (borland.public.delphi.database.ado)