Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select only empty records.
Message
From
22/04/2003 16:58:19
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
CodeMine
Title:
Select only empty records.
Miscellaneous
Thread ID:
00780347
Message ID:
00780347
Views:
39
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()
Next
Reply
Map
View

Click here to load this message in the networking platform