Re: Problem with Master/Detail tables




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: DataGridViews, Master-Detail, Data-entry *and* Display
    ... I haven't figured out how to get the detail grid to ... display *only* the related records for the selected row in the master ... when a row in the master grid is clicked. ...
    (microsoft.public.dotnet.languages.vb)
  • DataGridViews, Master-Detail, Data-entry *and* Display
    ... datatables are filled from another tier. ... I have the display part working fine ie. if you click in the master ... the detail grid is filled the required details. ...
    (microsoft.public.dotnet.languages.vb)
  • DataGridViews, Master-Detail, Data-entry *and* Display
    ... datatables are filled from another tier. ... I have the display part working fine ie. if you click in the master ... the detail grid is filled the required details. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: DataGridViews, Master-Detail, Data-entry *and* Display
    ... datatables are filled from another tier. ... I have the display part working fine ie. if you click in the master ... the detail grid is filled the required details. ...
    (microsoft.public.dotnet.framework.adonet)
  • How to select a target datagrid row in dragdrop operation?
    ... I have a master/detail form with 2 datagrids: selecting a row on the master grid updates the detail grid. ... I have a requirement to drag rows from the detail grid and drop them on a master row to initiate a data move routine. ...
    (microsoft.public.dotnet.framework.windowsforms)