Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select and Grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
01034869
Message ID:
01034905
Vues:
21
John,

Actually with the way you are doing it, all you should need to do is wrap the SELECT statement with the following:
In the AfterRowColChange method:
LOCAL lcAlias as String
* Only do this when the row changes
IF INLIST(this.RowColChange, 1, 3)
  WITH this.Parent.grdChild
    lcAlias = .RecordSource
    .RecordSource = ''
    * Requery here
    SELECT ... INTO CURSOR (lcAlias) ...
    .RecordSource = lcAlias
  ENDWITH
ENDIF
HTH,
Chad


>>VFP8. I have a form with parent record data and two grids to display data from child records. I use an SQL select to create cursors for the grids which use the cursors for a record source. When the form opens the grids with the child record data display correctly. However, if I move to a new parent record and at the same time do new SQL select statements using the same cursor name to get new child data for the grids, the grid data and headings disappear and remain missing until I start all over again. What am I doing wrong? TIA.
>
>You should not SELECTing in the same cursor.
>First SELECT (In Init event or Load Event of the Form) SELCT .... FROM .... INTO CURSOR YourGridCursor READWRITE
>
>When you want to ReSELECT
>
>
>SELECT .... FROM .... INTO CURSOR DifferentCursor
>
>thisform.LockScreen = .t.
>SELECT YourGridCursor
>ZAP
>APPEND FROM (DBF("DifferentCursor"))
>USE IN SELECT("DifferentCursor")
>thisform.LockScreen = .t.
>
>
>BUT I recomend you to move to CursorAdapters with parameters, Then you just issue:
>
>thisform.CAClassInstance.CursorRefresh()
>thisform.Grid1.Refresh()
>
_________________________________
There are 2 types of people in the world:
    Those who need closure
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform