Subject Re: Form to Form
From Lee Grant <camilee@nospam.comcast.net>
Date Sat, 10 Jun 2023 21:22:57 -0400
Newsgroups dbase.getting-started

Peter,

I think (emphasis on think) the problem, if I don't find and fix it
before Mervyn pipes in, is that you're opening two different query's in
two different forms, and assuming the one can read the other forms
rowset. That's not the way it works. If you have a main form, and it
calls a child form, the child form can access the parent form's
information, if it has the parent's object reference which your code
does, but it's trying to use the query information from the parents
information to fill your child's query fields.

In other words, your child form should have their datalinks point to the
parent form's query data...and you do something like this in the method
that calls the child form and set's the necessary links before it opens
the child something like this:

       form.TLF1.EFTRIPCPRONO1.DATALINK =
form.triplistdata.rowset.fields["cprono"]
                form.TLF1.EFTLSTATUSORDER.DATALINK =
form.triplistdata.rowset.fields["TLStatOrder"]
form.TLF1.readmodal()

This is form I made that Mervyn helped me with several years ago. The
TLF1 refers to the datalinks in the child form, but being filled by the
data from the form.triplistdata rowset of the parent's query.

My form was actually more complex, as I was using two query objects, 1
to display the data visually, and one to actually be the background data
that was changed...and when finished with the change and saving the data
I would requery() both rowsets to update them both, the data rowset and
the visual rowset.

This, I think is why you're having the problem of getting the child form
to be in sync with your parent form.

Lee

On 6/10/2023 11:41 AM, Peter wrote:
> Peter wrote:
> As you requested I am attaching the 2 forms, an edited dbf with mdx and dbt files.  I hope all this will fit in the attachments area.
> Please excuse my using "Mervyn" for the files!  I do like the "Harry Potter" series, so the patients are obvious. All data has been made up and represent no known persons.
> Peter
<snip>