Subject Re: AutoFill_entryfield error
From Tom <IHaveNoEmail@ddress>
Date Sun, 17 May 2020 17:09:27 -0400
Newsgroups dbase.getting-started
Attachment(s) Parallels Picture3.png

On 5/17/20 4:55 PM, Ken Mayer wrote:
> On 5/17/2020 12:55 PM, Ken Mayer wrote:
>> On 5/17/2020 12:22 PM, Tom wrote:
>>
>>>     Function Form_onOpen
>>>     * ----------------------------- *
>>>        form.AUTOFILL_ENTRYFIELD21.databaseName := "CONTACTSDATA"
>>> //"MyApp_Data"
>>>        form.AUTOFILL_ENTRYFIELD21.tableName    := "zContact"
>>> //"Autofill_Cities"
>>>        form.AUTOFILL_ENTRYFIELD21.fieldName    := "FullName"
>>> //"CityNames"
>>> //      this.dataBaseName := "CONTACTSDATA"
>>> //      this.tableName := "zContact"
>>> //      this.fieldName := "FullName"
>>>     return
>>
>>> endclass
>>>
>>
>> Without more information, like full working code and tables and
>> everything else, I have no idea.
>
> Only thing I can figure based on the error is to check and make sure the
> database is defined properly, and that the table is where you say it is.
> Because, honestly, I have no clue. I haven't done extensive testing on
> using two different databases for this, for example, which you appear to
> be doing.
>
> Ken
>
*
Hi Ken,
I was under the impression that using a different table as the source
was permitted. Correct me if I am wrong. Included is a new working
sample for testing whenever you have time.
Tom
*
Source Code:
*
if file("UserData.dbf")
    drop table UserData
endif
*
If not file("UserData.dbf")
    create table UserData (UserID character(5), LastName Character(15),
PRIMARY KEY( UserID ) )
    insert into UserData (UserID,LastName) values ("10001","Gildersleve")
    insert into UserData (UserID,LastName) values ("10002","Jones")
    insert into UserData (UserID,LastName) values ("10003","Smith")
endif
*
// a local table found in the current folder...
*
** END HEADER -- do not remove this line
//
// Generated on 05/17/2020
//
parameter bModal
local f
f = new BugFormD()
if (bModal)
    f.mdi = false // ensure not MDI
    f.readModal()
else
    f.open()
endif

class BugFormD of FORM
    set procedure to :dUFLP:autofill_entryfield.cc additive
    with (this)
       onOpen = class::FORM_ONOPEN
       metric = 6        // Pixels
       colorNormal = "LightGrey"
       height = 352.0
       left = 525.0
       top = 0.0
       width = 280.0
       text = "Demo Form"
       icon = "resource #200"
    endwith

    this.DATABASE1 = new DATABASE(this)
    with (this.DATABASE1)
       left = 4.0
       top = 245.0
       width = 53.0
       height = 37.0
       databaseName = "DBASESAMPLES"
       active = true
    endwith

    this.QUSERDATA = new QUERY(this)
    with (this.QUSERDATA)
       left = 13.0
       top = 96.0
       width = 57.0
       height = 37.0
       sql = "select * from UserData.dbf"
       active = true
    endwith

    this.QSAMPLES = new QUERY(this)
    with (this.QSAMPLES)
       left = 79.0
       top = 243.0
       width = 49.0
       height = 37.0
       database = form.database1
       sql = "select LastName from Customers"
       requestLive = false
       active = true
    endwith

    this.AUTOFILL_ENTRYFIELD21 = new AUTOFILL_ENTRYFIELD2(this)
    with (this.AUTOFILL_ENTRYFIELD21)
       dataLink = form.quserdata.rowset.fields["LastName"]
       height = 22.0
       left = 41.0
       top = 50.0
       width = 196.0
    endwith

    this.rowset = this.quserdata.rowset

    Function Form_onOpen
    * ----------------------------- *
       form.AUTOFILL_ENTRYFIELD21.databaseName := "DBASESAMPLES"
//"MyApp_Data"
       form.AUTOFILL_ENTRYFIELD21.tableName    := "Customers"
//"Autofill_Cities"
       form.AUTOFILL_ENTRYFIELD21.fieldName    := "LastName" //"CityNames"
       *
    return
    *

endclass
*
Image attached.