Subject Re: this.parent
From Ken Mayer <>
Date Wed, 18 Nov 2020 21:08:27 -0800
Newsgroups dbase.getting-started

On 11/18/2020 7:28 PM, Moses Hanna wrote:
> Hi
> I have an entryfield object ... form.visitcr.time1ef
> If i want to refer to it from rowset.cannavigate function
> I am using        if not empty(form.visitcr.time1ef.value)
> gives me error msg variable undefined
> i this I have to use something like this.parent... etc but I dont get it
> exactly
> some help ?
> Moses

The rowset (and query) objects do not know what a form is. There are
multiple ways around this, including adding a custom property to the
query object such as:

form.queryname.parent = form

Another is in the rowset's canNavigate code:

this.parent.parent // parent 1 = query, parent2 = form

In a case like that I tend, in my own code to put the form reference
into a variable:

oForm = this.parent.parent

Then I can refer to any objects in that code:


(or whatever ... modify as needed)

If the query is in a datamodule it gets more complex, but hopefully this
will give you the right ideas.


*Ken Mayer*
Ken's dBASE Page:
The dUFLP:
dBASE Books:
dBASE Tutorial: