Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with grid display and SET RELATION
Message
De
21/03/2005 13:15:00
 
 
À
21/03/2005 13:03:31
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Divers
Thread ID:
00997872
Message ID:
00997904
Vues:
19
What I actually had (since replaced by your suggestion ...) was:

for grid1:
USE MyTable AGAIN in 0 ALIAS MyTable1
USE MyJobs AGAIN in 0 ALIAS MyJobs1
SET RELATION to Jobidnum IN MyTable1 INTO MyJobs1
Similary, for grid2:
USE MyTable AGAIN in 0 ALIAS MyTable2
USE MyJobs AGAIN in 0 ALIAS MyJobs2
SET RELATION to Jobidnum IN MyTable2 INTO MyJobs2
Now, this failed, so all I trying to understand is why it does fail, as I thought using separate files like this gave me separate record pointers.

You also mentioned buffering, and I'm not sure what you're referring to. I'm not using any kind of buffering myself.

Cheers,
Jim


>You've. However also consider the buffering. Use again would lack having other's buffered items.
>I think then your problem is with alias. In your code you said:
>
>use myTAble again
>
>and it wasn't clear if you added 'alias' clause or left it to VFP. I explicitly define my alias when I use 'again'.
>Cetin
>
>>OK ... but when I opened my JOBS file AGAIN, so that each grid was using a SET RELATION to a different alias of that JOBS file, don't I have the luxury of a separate record pointer in each alias? (hmmm, obviously I don't, but why not? I thought opening a file AGAIN allowed me to do so.)
>>
>>
>>>Jim,
>>>Relations act on record pointer. There were 2 grids forcing one poor slave to change its pointer:)
>>>Cetin
>>>
>>>>Cetin --
>>>>
>>>>That substitution works fine, and the problem disappears. Thanks so much for a different approach.
>>>>
>>>>Now -- is there a brief explanation of why my original approach failed? Always glad to learn from my mistakes (er, misunderstandings) ...
>>>>
>>>>Jim
>>>>
>>>>
>>>>>>I have a form where I have two different grids that are showing records from the same table. I have used "USE filename AGAIN" to open multiple aliases of the table, with different filters for each grid.
>>>>>>
>>>>>>The grid display includes a field from another table named "JOBS". For each of my grids, I set the RELATION into JOBS for the table, and then referenced JOBS.Descript as a controlsource for a column in the grid.
>>>>>>
>>>>>>What happens is that I do not see the correct value for JOBS.descript unless I focus on the grid; originally this column is blank in both grids, and if I click on one of the grids, it show correctly there; if I then click on the other grid, it shows correctly as well, but the values in the first grid disappear!
>>>>>>
>>>>>>I must say that I also tried opening my JOBS file again for each grid, using "USE filename AGAIN", as I thought there might be some conflict with using SET RELATION into the same file. However, I got the same display problem this way as well.
>>>>>>
>>>>>>So, how come the SET RELATION only shows up in the grid if I focus on it?
>>>>>>
>>>>>>Thanks,
>>>>>>
>>>>>>Jim
>>>>>
>>>>>Jim,
>>>>>Instead of relation try an expression as controlsource. ie:
>>>>>
>>>>>(iif(seek(myAlias1.JobID,'jobs','jobIDTag'), jobs.description, ''))
>>>>>
>>>>>Cetin
Jim Nelson
Newbury Park, CA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform