Subject Re: QUERY ON FORM
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Sat, 20 Jan 2018 15:03:12 -0800
Newsgroups dbase.getting-started

On 1/20/2018 1:53 PM, Mustansir Ghor wrote:
> Dear All
>
> I have put  following statement on form_open() method (xyz.dbf has fields code, name)
>
> mq1 = new query()
> mq1.sql = select * from c:xyz"
> mq1.active = true
>
> when I refer to this query later in the form with following statement it says variable mq1 undefined
>
> form.mq2,rowset,fields["item"].lookuprowset = mq1.rowset
>
> Can anybody guide where is the error.
>

You need to make it a property of the form:

    form.mq1 = ...

It is not automatically such, as a matter of fact it is only available
in the form's open() method the way you have the code written.

Ken


--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm