Jim:  I have a form where the user can do a variety of things.
There are checkboxes they can select, there are combo boxes
of values they can select, and there are free-form boxes where
they can type in things like dates.   But they select at least one
thing in order to print.  Here's how I do it:

1.    In the program I initialize all the values to null, then bring 
up the form to edit, like this:

SET VAR vBDate DATE = NULL, vEDate DATE = NULL, +
  vStat TEXT = NULL, vClientID INT = NULL
EDIT USING printinvoice

2.    There is a "print" and a "cancel" button on the form.  The Print
button does all the checking and concatenating of the where clause:

IF vBdate IS NULL AND vEdate IS NULL +
  AND vClientID IS NULL AND vStat IS NULL THEN
  PAUSE 2 USING 'You did not enter any parameters to search for!' +
    CAPTION 'ERROR!' ICON STOP OPTION MESSAGE_FONT_SIZE 11
  RETURN
ENDIF

SET VAR vWhere TEXT = 'po IS NOT NULL'

IF vBDate IS NOT NULL THEN
  IF vEDate IS NULL THEN
    SET VAR vWhere = (.vWhere & 'AND ordate = .vBDate')
  ELSE
    SET VAR vWhere = (.vWhere & 'AND ordate BETWEEN .vBDate AND .vEDate')
  ENDIF
ENDIF

IF vClientID IS NOT NULL AND vClientID <> 0 THEN
  SET VAR vWhere = (.vWhere & 'AND ClientID = .vClientID ')
ENDIF
... etc, you get the idea

PRINT reportname WHERE &vWhere



Hope that gives you some ideas!

Karen







 
> I want to get into an area I have not entered before so I will need some 
> guidance.
> 
>  My goal is to have a form with multiple choices (either will check boxes 
> or type in fields) that will print a report based on those choices.\
> 
>  I assume I will need a series of Switch/endswitch codes.
> 
>  I foresee my question being, “How do you eliminate the NULLs in the 
> choices and combine all the choices into a WHERE or SELECT clause.
> 
>  I looked at the example SelfDesigningReports in RRBYW14 but that is not 
> what I want. 
> 
>  
> 
>  Jim
> 
>   
> 
>  
> 

Reply via email to