| Subject |
Re: how to place an index on this form |
| From |
Andy Taylor <andy.taylor.1959@outlook.com> |
| Date |
Sun, 20 Sep 2020 11:10:49 -0400 |
| Newsgroups |
dbase.getting-started |
Agostinho,
There is no provision in the form designer for specific index setting where you are using a workarea alias and the browse control.
However you can add the code manually.
Ken has already suggested setting it up using the XML code "use .... order...." either before you run the form or as code that you enter before the form header. You can also add it to an appropriate event handler within the form like onOpen. I have added a codeblock to the BROWSE1 object as follows:
this.BROWSE1 = new BROWSE(this)
with (this.BROWSE1)
onOpen = {;select verw_Oud; set order to kCode; go top}
fontName = "Calibri"
fontSize = 11.0
height = 10.08
left = 3.0
top = 4.8
width = 65.0
alias = "VERW_OUD"
endwith
Replace your existing Browse1 code with the above and you will find the new code under the "Events" Tab of the Inspector when you open the form with the designer.
You will find very good reading within chapters 5 & 6 of the dBASE users guide:
C:\Program Files (x86)\dBASE\dBASE2019\Docs\dBASE_2019_Users_Guide.pdf
Finally, I will add my voice to the others and suggest that you look at the modern way of using the built in data control objects and run through Ken's excellent & free tutorial.
Regards,
Andy
> Sorry that on my form I missed the table that I added from the inspector onto the brows object.
> I know there are better ways to do this but I just want to make an experiment.
> I will be more than thankful if I get help from the group, if not than I will
> try from other sources.
> Thanks
>
> ** END HEADER -- do not remove this line
> //
> // Generated on 09/18/2020
> //
> parameter bModal
> local f
> f = new NOBROWSForm()
> if (bModal)
> f.mdi = false // ensure not MDI
> f.readModal()
> else
> f.open()
> endif
>
> class NOBROWSForm of FORM
> with (this)
> height = 16.0
> left = 26.7778
> top = 1.32
> width = 73.2222
> text = ""
> view = "VERW_OUD.DBF"
> endwith
>
> this.BROWSE1 = new BROWSE(this)
> with (this.BROWSE1)
> height = 10.08
> left = 3.0
> top = 4.8
> width = 65.0
> alias = "VERW_OUD"
> endwith
>
> this.ENTRYFIELD1 = new ENTRYFIELD(this)
> with (this.ENTRYFIELD1)
> onKey = class::ENTRYFIELD1_ONKEY
> height = 2.4
> left = 3.0
> top = 0.48
> width = 29.0
> value = ""
> endwith
>
> function ENTRYFIELD1_onKey(nChar, nPosition,bShift,bControl)
> ccode=form.entryfield1.value
> seek ccode
> return
>
> endclass
>
>
>
>
> Ken Mayer Wrote:
>
> > On 9/18/2020 11:34 AM, agostinho wrote:
> > > Dear group see this form bellow, it's a very simple one.
> > > I'm trying to place an index (INDEXNAME="KCODE" on the form to make it work.
> > > I got the alias database.dbf option on the INSPECTOR but I don't see any option for index option.
> > > If this is not possible from the inspector than how/where on the form him self.
> >
> > It helps if you learn to use the data objects in dBASE, that way you
> > have the control you're looking for. Where exactly are you opening the
> > table? It's not being opened by the form itself. Are you doing it in a
> > program? If so, in the program you need to add the index:
> >
> > use tablename order kcode
> >
> > Then call the form, and it should be indexed.
> >
> > If you use the data objects, you have to place a query object on the
> > form, the simplest way is, in the Form Designer, go to the navigator,
> > click on the tables tab, and drag the table to the form. Then you could
> > set the index using the rowset's indexName property ...
> >
> > I really suggest that if you're going to use current versions of dBASE
> > you consider the (free) tutorial in my link signature block below ...
> >
> > 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
>
|
|