Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
01096209
Message ID:
01096405
Vues:
15
Kevin,

Check http://weblogs.foxite.com/andykramek/archive/2005/03/19/174.aspx


>I'm using this to create a grid of search results. If no Station selected, then all records
>are shown. If a Station is selected, the the query's WHERE clause is changed to include it.
>
>The first time I run it, I see data in the grid, after that, the grid is empty even though
>the query returned data:
>
>
>** If no Station is selected and the Show Paid only checkbox is off, then
>** create a default WHERE clause
>IF EMPTY(.cboStations.DisplayValue) AND .chkUnpaid.Value = 0
>  cWhere = ".T."
>ENDIF
>
>** If a Station is selected, add it to the WHERE clause
>IF NOT EMPTY(.cboStations.DisplayValue)
>  cWhere = cWhere + " StatName = '" + PADR(.cboStations.DisplayValue, 10, " ") + "' AND "
>ENDIF
>
>** If the Show Paid only checkbox is on, then add it to the WHERE clause
>IF .chkUnpaid.Value = 1
>  cWhere = cWhere + " NOT Scanned AND "
>ENDIF
>
>** Remove trailing 'AND'
>cWhere = ALLTRIM(cWhere)
>cWhere = SUBSTR(cWhere, 1, LEN(cWhere) - 3)
>
>** Of no sort column was passed in, use the default columns.
>IF EMPTY(cSortOrder)
>  cSortOrder = "StatName, InvoiceId"
>ENDIF
>
>** Run the query
>SELECT StatName, InvoiceId, DoneDate, UserId, Scanned ;
>  FROM Commits ;
>  WHERE &cWhere ;
>  GROUP BY StatName, InvoiceId;
>  ORDER BY &cSortOrder ;
>  INTO CURSOR ReconData
>
>
>.BindControls = TRUE
>.Refresh()
>
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform