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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filters and Private Data Sessions 1

Status
Not open for further replies.

SGLong

Programmer
Jun 6, 2000
405
US
I've been trying to resolve this problem for about 5 hours now and I'm getting nowhere fast. I have a form with a private data session. In the data environment I'm opening 3 tables from two separate DBC's - one from LEDGER and two from CONTACTS. In the INIT method of the form I am receiving a parameter (which_type) from another form. Here's the code form my INIT method:

parameters which_type
set database to ledger
select tax_file
set filter to tax_type=which_type
go top
.... more code (unrelated to filter or table)....

When I run the form I get a wait window message ("Filter Cleared"). I do not have anything in my form that would change the filter status (or show a wait window). I've used debugger but it hasn't revealed the source of the filter being cleared. I can tell that the filter is set when I leave the INIT method and the "Filter Cleared" message pops up as I enter the REFRESH method.

Does anyone have any idea where or how the filter is being cleared?

Steve
 
Steve,
Because "which_type" can only be seen in the INIT() method (or only has scope in it), then it's undefined elsewhere.

You either need to save the value off in a form property or use the value itself in the filter.

1)
select tax_file
ThisForm.r_which_type = which_type
set filter to tax_type=ThisForm.r_which_type

2)
select tax_file
** assumes which_type is numeric
lcFilter = "tax_type="+STR(which_type)
set filter to &lcFilter

3)
select tax_file
** assumes which_type is string
lcFilter = "tax_type='"+which_type+"'"
set filter to &lcFilter

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top