Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SET FILTER... problem 1

Status
Not open for further replies.

torturedmind

Programmer
Jan 31, 2002
1,052
PH

hello people. i have this small question about SET FILTER. i have a free table placed in a form's dataenvironment. this table contains several records and the records are group by a field grp_id and is not indexed. in the form's INIT method i have the following:
Code:
lparameters grp_filter

select opdstat
set filter to grp_id = iif(parameters() = 0, 1, grp_filter)
go top
then in vfp6's command window, i call the form
Code:
do form myform.scx
do form myform.scx with 1
in the first DO FORM command, the SET FILTER kicks in with no problem. but in the second, all records were displayed regardless of grp_id. what gives? [neutral]

thanks in advanced.

kilroy [knight]
philippines

"Once a king, always a king. But being a knight is more than enough."
 
thanks sir mike (wow, there sure are lots of mikes here) #3 tip did the trick. and thanks for the advice. i'll keep 'em all in mind. peace! [peace]

kilroy [knight]
philippines

"Once a king, always a king. But being a knight is more than enough."
 
just a slight change:
Code:
LPARAMETERS m.tnGrp_Filter
LOCAL m.lcFilter

m.lcFilter = "GRP_ID="+IIF(Vartype(m.tnGrp_Filter)#"N","1",TRANSFORM(m.tnGrp_Filter))

SET FILTER TO &lcFilter.
LOCATE

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top