Subject Re: MOVE TO THE SEARCHED RECORD ON THE BROWS OR GRID ON THE FORM
From AGOSTINHO <AGOSTINHOTEIXEIRA@YAHOO.COM>
Date Mon, 14 Sep 2020 23:43:33 -0400
Newsgroups dbase.getting-started

Dear Andy thank you very much, it worked perfectly.
Also a special thanks to Mervyn,Gateano and Akashat for your assistance
Agostinho

Andy Taylor Wrote:

> Agostinho,
>
> Your form works perfectly after a bit of tweaking. Your error I suspect lies in the table.
> I moved some of your code from the constructor to the onOpen event because the products alias does not exist at the time of form creation.
> I added a table creation routine and called it Products99 to avoid a clash with your real table:
> Run the code and come back with any further issues.
>
> Regards,
> Andy
>
> *----- Agostinho.wfm form code starts here-------------------------------------------*
> // create the products99 table
> if not file("Products99.dbf")
>    create table products99 (Code character(4), Merk character(4), Product character(10))
>       use products99 excl
>       aData = {"ID01","5607","Widget","ID02","9987","Hammer","ID03","9988","Chisel"}
>       aData.resize(3,3,0)
>       append from array aData
>       index on Code tag PrCode
>       use
> endif
>
> ** END HEADER -- do not remove this line
> //
> // Generated on 09/13/2020
> //
> parameter bModal
> local f
> f = new AGUSTForm()
> if (bModal)
>    f.mdi = false // ensure not MDI
>    f.readModal()
> else
>    f.open()
> endif
>
> class AGUSTForm of FORM
>    with (this)
>       onOpen = class::FORM_ONOPEN
>       height = 16.0
>       left = 42.8889
>       top = -0.52
>       width = 77.1111
>       text = ""
>    endwith
>
>    this.BROWSE1 = new BROWSE(this)
>    with (this.BROWSE1)
>       height = 9.12
>       left = 9.0
>       top = 5.76
>       width = 57.0
>    endwith
>
>    this.ENTRYFIELD1 = new ENTRYFIELD(this)
>    with (this.ENTRYFIELD1)
>       onKey = class::ENTRYFIELD1_ONKEY1
>       height = 2.88
>       left = 3.0
>       top = 0.96
>       width = 22.0
>       value = ""
>    endwith
>        
>    function ENTRYFIELD1_onKey1(nChar, nPosition,bShift,bControl)
>       ccode=form.entryfield1.value
>       Find &ccode
>       return    
>
>    function form_onOpen()
>       USE PRODUCTS99 ORDER PRCODE alias Products99
>       form.browse1.alias = "PRODUCTS99"
>       form.browse1.fields = "PRODUCTS99->CODE,PRODUCTS99->MERK,PRODUCTS99->PRODUCT"
>       return
>
> endclass
>
> *----- Agostinho.wfm form code ends here-------------------------------------------*
>
> > Dear group,
> > On my form I search a record on the table but how do I move to the record
> > on the brows or grid object on the form using this method
> > SEE MY FORM BELLOW
>