Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Search and SET RELATION don't like each other
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00502705
Message ID:
00503050
Vues:
24
>Hi!
>
>>>Hi!
>>>
>>>When you search in the child table, you require to move record in the parent table in order to show child record after you restore relation. Yet I see nothing in your code that move record pointer in the parent table (BldMstr) after you find record in the child table. Even if the record you find is the record witrh the same parent record, you should use 'Go recno("BldMstr") in BldMstr' after settiung a relation to apply this relation to the child table. After this, however, record pointer in the child table will move to the first record from the range for parent table, thus you require to remember it before this and than restore to show it properly in the child grid.
>>>
>>>As about question how this could be done by another way: this could be done using a lot of different ways. Examples:
>>>
>>>SET FILTER instead of relation.
>>>SET KEY instead of relation (will be the best replacement in your case because you already use filter)
>>>Using of the parametrised view. Will be somewhat slower, but is not as important as development time and maintenance - this way requires more time.
>>>
>>>HTH.
>>
>>Hi Vlad,
>>
>>First of all, thanks for looking into this thread. I just tried SET KEY, but I could not make it work. If I'll use parameterized view, it will mean, what grid will reconstruct each time, right? Of course, I can try your idea of avoiding grid reconstruction. I may try filter idea. The Lender table contains only ~1000 records, so I dont' think, it would be a significant delay.
>>
>>Anyway, strange, why I can't use SET KEY. This is how I tried it:
>>GrdBldMstr.AfterRowColChange
>>
>>select BldMstr
>>lcKeyValue=left(nvl(lName,substr(OldValue,8)),1)
>>*!*	if thisform.lJustSearched
>>*!*	   set key to in Lender
>>*!*	endif
>>*if not thisform.lJustSearched
>> set key to m.lcKeyValue in Lender
>>
>>*endif
>>
>>It shows only one record and it doesn't change, when I navigate between records. I want to show all records in Lender, which starts from the specific letter, say, all records with first letter F in Lender.Short. Lender uses short as order, and I set exact off.
>>
>
>Lender grid should be refreshed after change of the 'SET KEY'. SET FILTER requires this too...
>
>*if not thisform.lJustSearched
> set key to m.lcKeyValue in Lender
> GrdLender.Refresh && refresh the Lender grid
>*endif
>
>
>I cannot beleive SET KEY does not work because it is such kind of the filter that works over indexes. Maybe index is corrupted? It also allows to specify a range, bounds of the range could equal - try this syntax. I remember I used this approach in a FPD 2.6 and it worked great with DOS browse windows.
>
>Well, you do not require view, just a select statement if this table is not editable ;)

I'll try again with SET KEY, though I just got working SET FILTER idea.

I don't understand your last sentence. Suppose, I set RowSourceType for the grdLender to be SQL and will use SQL instead of Alias. When I do select again (in GrdBldMstr.AfterRowColChange, does it mean, that grid reconstructs or not? If not, I'll better try this idea, right?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform