Newbie Quaestion on Referencing dataset from ShowModal Window




I have a form containing an ADO dataset. I want to have a
ShowModal form have access to the parent form's dataset.

Since the modal form is shared among many different parent
forms, I don't want to implement this with USES MyParentForm,
but instead "reference" the parent's dataset object with a
dataset object variable in the modal form.

I tried this:

****** Parent Form
MyModalWindow := TMyModalWindow.Create(Self);
MyModalWindow.MyModalDatasetObject := MyParentDataset;
MyModalWindow.ShowModal;

****** MyModalWindow
Public Declaration
MyModalDatasetObject: TADODataSet;
....
If MyModalDatasetObject.State in [dsInsert, dsEdit] then
Do Something...

Although there are no compilation errors, this approach doesn't
work.. I guess I'm not referencing the parent form's dataset
correctly. Can anyone please give me some sample code to
accomplish this?

Thanks.

.



Relevant Pages

  • Re: Modal App, that will freeze Windows?
    ... But since I got Internet at my home, everybody thinks its fun to use my ... will freeze windows, it will be ok.But seems like you have to have a ... parent for a modal form, witch means it will only be modal to my ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ActiveX Control, Displaying modeless form -- Error 401
    ... Difficult to analyze with some code to see how you do it (and in what order, ... ActiveX conrol on to a from in my parent application, ... error 401 "can't show non modal form, ... parent application to loose focus. ...
    (microsoft.public.vb.general.discussion)
  • Re: How do you use one dataset in multiple forms?
    ... In your modal form ... ... Dim mdlDialog as new ModalForm ... the parent form and access the data set that way. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Newbie Quaestion on Referencing dataset from ShowModal Window
    ... If you step into the code does MymodalDatasetobject get a value when you create the form? ... ShowModal form have access to the parent form's dataset. ... Since the modal form is shared among many different parent ... dataset object variable in the modal form. ...
    (borland.public.delphi.database.ado)
  • Re: Placing a modal form on the parent
    ... > I have to place a modal form on a specific spot on the parent. ... > of a RichTextBox on the parent. ...
    (microsoft.public.vb.winapi)