Kevin,
It makes complete sense. But I think your going about it backwards too. :)
The EXTERNAL() operator could be used like your suggesting, but you
will face the issues that you have. Or your Table qualification has to
know about "Select all" and "opt out" that portion of the
qualification. Something like:
'UserID' = $UserID$ AND ('Field1' = EXTERNAL($menu1$) OR $menu1$ = 3)
AND ('Field2' = EXTERNAL($menu2$) OR $menu2$ = 3) AND ('Field3' =
EXTERNAL($menu3$) OR $menu3$ = 3)
However if you ever have to add a new value to one of those menus then
life gets messy because you have to update the table field as well.
In stead of that.... I would suggestion the following approach.
Add a hidden display only field that you set with the values from the
three fields on menu choice of any of the three fields. ('zTableQual')
So three active links on "menu selection" for the fields to call this
guide. The guide sets 'zTableQual' based on the values in the three
fields. So the guide logic would be something like the following:
Guide #1: Set zTableQual
'zTableQual' = $NULL$
if ( $menu1$ != $NULL$ AND $menu1$ < 3)
'zTableQual' = ( 'Field1' = "$menu1$" )
if ( $menu2$ != $NULL$ AND $menu2$ < 3)
Call guide #2
'zTableQual' = 'zTableQual'+ ( 'Field2' = "$menu1$" )
if ( $menu3$ != $NULL$ AND $menu3$ < 3)
Call guide #2
'zTableQual' = 'zTableQual'+ ( 'Field3' = "$menu1$" )
Guide #2:
if ( 'zTableQual' != $NULL$ )
'zTableQual' = 'zTableQual'+ (" AND ")
Then the table qual would be:
'UserID' = $UserID$ AND EXTERNAL($zTableQual$)
If you logic changes for any of the three fields then just update
Guide1 to "do the right thing" with the 'zTableQual' string that you
build and your done.
If you even want to allow the user to specify "OR"s instead of "AND"s
you could do that too. (and maybe even get fancy enough to let them
set parenthesees around which parts would be OR'ed and which parts
would be AND'ed. too. :) And the table qual stays the same!
Yea it looks like "more work", but you also can choose to avoid OR
conditions which can help with RDBMs performance in the long run.
Just my two cents.
--
Carey Matthew Black
Remedy Skilled Professional (RSP)
ARS = Action Request System(Remedy)
Solution = People + Process + Tools
Fast, Accurate, Cheap.... Pick two.
Never ascribe to malice, that which can be explained by incompetence.
On 8/8/06, Kevin R. Carmack <[EMAIL PROTECTED]> wrote:
Greetings All,
I'm hoping someone can help with a table field qualification problem I've
been trying to figure out.
Form A has a table field that shows all entries from Form B where 'UserID'
on Form A = 'UserID' on Form B. I need to have 3 drop-down menus on Form
A that can be used to "filter" the table. The user should be able to
choose a value in any one of these menus to further refine the table field
qualification.
These menu fields are copies of fields from Form B with an extra option
added in the Attributes for "Show All." So, if the menu field on Form B
has values of 0, 1, and 2, the corresponding menu field on Form A will
have values of 0, 1, 2, and 3 with the 3 being "Show All."
If I use the EXTERNAL feature so that the table qualification is dynamic,
what happens if the user doesn't use the menus on Form A, or only chooses
a value other than "Show All" on 1 or 2 of them?
For example, I have the following qualification:
'UserID' = $UserID$ AND 'Field1' = EXTERNAL($menu1$) AND 'Field2' =
EXTERNAL($menu2$) AND 'Field3' = EXTERNAL($menu3$)
However, if the menu on Form A is "Show All" then I need the qualification
to ignore the 'Field' = EXTERNAL($menu$) bit of the qualification so that
it brings back all entries regardless of the value of 'Field'. Does this
make sense?
_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at http://www.wwrug.org