Subject Re: GRID NAVIGATION
From Andy Taylor <andy.taylor@which.net>
Date Fri, 14 Jul 2017 07:30:13 -0400
Newsgroups dbase.getting-started

Mustansir,

Don't know why your navigation does not reset the focus correctly on your subsequent navigations...
Are you sure that it is not getting caught by the cases?
Try the following code...
do case
   case fields["resulty"]="L"
      msgbox("Case L fired")
   case fields["resulty"]="M"
      msgbox("Case M fired")
  otherwise
   form.myentryfield1.setfocus()
   msgbox("setfocus fired")
endcase

Hope it helps,
Andy

> Dear all
> I am using below funtion fro grid navigation. for the first navigation it stop at entryfield.setfocus. But on subsequent navigation it does but it does not stop there and returns to the grid immidiately.
>
> function GRID1_onSelChange()
>            form.mytext2.text=form.labres1.rowset.fields["item"].value
>            with (form.labres1.rowset)
>                  do case
>                         
>                   case fields["resulty"]="L"
>          
>                   case fields["resulty"]="M"
>
>                   otherwise
>                   form.myentryfield1.setfocus()
>
>                  endcase
>                 endwith
>     return
...form snipped....
>
> Anybody can see the error
> Best Regards
> Mustansir