Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select only empty records.
Message
De
22/04/2003 16:58:19
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
CodeMine
Titre:
Select only empty records.
Divers
Thread ID:
00780347
Message ID:
00780347
Vues:
40
I am passing a value to a form's init method. I want to return the records that match that value. It is working great except if the value is empty. IF the value is empty then the select returns all records, not just the empty ones. How can I return just the empty ones:

MYFORM.INIT:
LPARAMETERS m.cToolSet
**if no toolset is passed, you are working on the Default header
**similarly, the default header has empty toolsets
IF !EMPTY(m.cToolset)
	thisform.ztoolset=ALLTRIM(m.cToolSet)
ELSE
	thisform.zToolSet=''
ENDIF

LOCAL loCursor
*-- Get a reference to the cursor. 
loCursor = thisform.cmDataManager.getCursor('trpthead')
*-- Just in case the order wasn't correctly set on the cursor.
loCursor.setOrder('ftoolset')
*-- Now, use the cursor's Select method. Way more efficient than a filter.
loCursor.Select(thisform.ztoolset)   && Or whatever value you want to pass.

THISFORM.REQUERY()
THISFORM.REFRESH()

DODEFAULT()
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform