Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Two highlighted grids and set relation
Message
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00601088
Message ID:
00601210
Views:
21
>Hi Nadya,
>
>I think that you don't need SET RELATION in this case because you overwrite it anyway with your code. Try to comment SET RELATION and see if it helps.
>

Hi Sergey,

Grid MersMstr should show records only for the town of the record in the upper grid. That's why the relation is used. I think, the whole problem could be solved using view on MersMstr by town, and requery it, if town changes + do seek. If it would be my application, I would use this technique. However, it's my colleague's. We were working together at the end of the work day on Friday, but it's hard to program over the shoulder. The current code doesn't work. We also tried remove relation before seek and restore it after, but this didn't work too. We tried several other modifications of the same code without success.

>>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.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform