Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Two highlighted grids and set relation
Message
De
07/01/2002 05:16:17
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00601088
Message ID:
00601425
Vues:
17
>Hi everybody,
>
>Here is a problem in my colleague's application. One table, aliased as BldMstr, is part of a database. It's in Situs order upper(TOWN+Street+str(StNum,5)+StNumExt+Unit). There is a free table, called MersMstr. It has the same index, but filtered.
>
>In the Load of the form SET EXACT OFF
>In the Init:
>
>select BldMstr
>set relation to town into MersMstr
>
>In the grdBldMstr.AfterRowColChange && I quote all code by memory
>
>lparameter nColIndex
>if this.nCurRec<>recno('BldMstr') && Change of the row
>   =seek(upper(BldMstr.town+left(BldMstr.Street,1)),'MersMstr')
>   if left(BldMstr.street,1)<>left(MersMstr.street,1)
>       =seek(upper(town)),'MersMstr')
>   endif
>   thisform.grdMers.nCurRec=recno('MersMstr')
>   thisform.grdMers.LocateRecordOnTop()
>endif
>dodefault(nColIndex)
>
>However, this code doesn't work in all cases. We see some strange behavior. For instance, when navigating in the grdBldMstr and town is changed, the Mers grid doesn't show the correct street record. However, the next record in the same town is shown correctly, and if we move up, the previously incorrect record is shown correctly now too. There are couple other oddities in those grids.
>
>Do you know, is it possible to make this form work using set relation? It could be probably solved by using view on MersMstr, but I'm afraid, it would be too complicated for my colleague to re-design...
>
>Thanks in advance.

IMHO relation+seek is calling for trouble. As soon as a refresh occurred grid would pull up the relation record. Remove relation and use set key.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform