Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Selecting data for grid
I have the following scenario:
I have a form (lets say Form1) where users can fill in the name, firstname... of a person. To check, if this person already exists, I want to start another form (lets say Form2) and display the "double" persons. I do this with a button in Form1 and the following click-event:
DO FORM .\MASKEN\DOUBLE.SCX WITH ALLTRIM(lcName)
I pass along a parameter with the lastname of the person.
In the init-event of Form2, I have the following code:
PARAMETERS lcDoubleSeek
lcSuche = lcDoubleSeek
If I understand VFP, I now have the lastname in lcSuche.
In Form2, I have a grid and I want it to display the double persons. So I put the following code in the init-event of my grid:
SELECT name, vorname ;
FROM person ;
WHERE ALLTRIM(name) = lcSuche ;
INTO CURSOR cDouble
The grid has the following properties:
RecordSource: cDouble
RecordSourceType: 1-Alias
I hoped that the grid would display the desired data - but it doesn't.
It displays data from another table (one from the dataenvironment for Form1), for Form2 I have defined no DataEnvironment.
What am I making wrong ?? What have I to do that Form2 display the correct data ?
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement