| Subject |
Re: applylocate not working |
| From |
Ken Mayer <dbase@nospam.goldenstag.net> |
| Date |
Fri, 7 Jun 2024 08:03:54 -0700 |
| Newsgroups |
dbase.getting-started |
On 6/7/2024 7:43 AM, Charlie wrote:
> I thought this would be easy since I have done this before but the apply locate is never found. tgrade is what i am trying to find. actually it represents a field in the table. so that isn't the problem (yet) because this never finds tid and cat which are also strings.
>
> i have tried this looking for bith variables and only one which certainly should have been found, but for some reason the applylocate doesn't work.
>
> Can anyone help?
>
Have you considered the locateOptions? Are you perhaps looking for a
string that is not matching based on case? What about length?
Adding the statement:
co.locateOptions := 3 // ignore case and length
The default is to match case, and match the length of the values you are
looking for. There are other options, see help for "locateOptions". I
have shown the best place to add this below:
>
>
> function COMBOBOX4_onChange()
> co = form.coins1.rowset
co.locateOptions := 3 // ignore case and length
> tgrade = trim(form.combobox4.value)
> tid = trim(form.entryfield5.value)
> tcat= trim(form.combobox2.value)
> //co.applylocate("year= '" + tid + "'")// and category= '" + tcat + "'")
> co.applylocate( "year= '" + 'tid' + "' and category= '" + tcat + "'")
> form.entryfield1.value = val(co.fields["&tgrade."].value)
> //if found()
> msgbox( ""+found() )
--
*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
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm
dBASE DOS to Windows Tutorial:
http://www.goldenstag.net/dbase/DtoWTutorial/00_Menu.htm
|
|