selection formula problem 
Author Message
 selection formula problem

I have a program that uses 4 db combos and 2 calander controls in vb.

Lets call thedb combos 1 2 3 and 4 and call the calander controls one
and 2. They default value for all controls is blank or null.

On each use the user may select any combination of these six controls.
Normally if they select 1 calander control they will use the second.
They represent a beginning and and date.

I need code that will test each control and make it part of the
selection formula if not blank or null.

I am installing beta very soon and would apreciate any help you can give
me.

Thanks,

Joe



Thu, 27 Apr 2000 03:00:00 GMT  
 selection formula problem

this is an example of concatenating a string that will be the selection
 criteria
depending on whether the combo box in question has significant text. I'm not
sure from your message how the calendar controls fit in.
I haven't tested the code below, but I think it  will work.  At any rate it
 demonstrates
the principle involved.

Dim strRptCriteria as string.  

If combo1 <> "" and  not (Isnull(combo1))  then
           strRptCriteria = "{qry1.field1} = " & "'" & combo1  & "'"
end if

If combo2 <> "" and  not(Isnull(combo1))  then
           strRptCriteria = strRptCriteria &  "{qry1.field2} = " & "'" & combo2
  & "'"
end if

CrystalReport1.SelectionFormula = strRptCriteria



Sun, 07 May 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Crystal Report Selection Formula Problem

2. Help with Multilple Selection Formula Problem

3. SELECTION FORMULA PROBLEM-REPOST

4. SELECTION FORMULA PROBLEM-REPOST

5. Selection.Formula problem

6. Using formula field in selection formula

7. Using formula field in selection formula

8. Using formula field in selection formula

9. Problem applying record selection formula

10. Problem passing date in selection formula

11. Problem in sending Selection Formula

12. Problem in Selection formula, CR 4.6, VB 6.0

 

 
Powered by phpBB® Forum Software