Help with Multilple Selection Formula Problem 
Author Message
 Help with Multilple Selection Formula Problem

When I run my app with the following Criteria in the Selection Formula I get
a
Run Time Error 13 Type Mismatch. This Criteria works when I enter it
directly
into the Selection Formula in Crystal and it works when I break each
criteria
out separately. However, when I stick them both together with an AND I get
the
error.

    Dim RecSelect1 As String, RecSelect2 As String, strAuditDate As String,
    Dim strBlank As String, RecSelect3 As String

       strAuditDate = InputBox("Enter Audit Date As CCYY,MM,DD:", "Report by
Audit Date")
           RecSelect1 = "{ADATA.DTAUDIT} =" & "Date(" & strAuditDate & ")"

       strBlank = ""
            RecSelect2 = "{ADATA.Comments}<> 'strBlank'"

        RecSelect3 = RecSelect1 And RecSelect2
            crysIndReport.SelectionFormula = RecSelect3

    crysIndReport.Destination = crptToWindow
    crysIndReport.Action = 1

I have tried this with other fields of the same format and I still get the
same
error. Do I have something wrong with my syntax in my AND.

Very much would appreciate your advice,

Thanks,

Gordy Frank




Tue, 12 Dec 2000 03:00:00 GMT  
 Help with Multilple Selection Formula Problem

Gordy,

Well, you cannot use VB 'and' function this way. You should have:
RecSelect3=RecSelect1 + " and " + RecSelect2

Tomasz



Quote:
> When I run my app with the following Criteria in the Selection Formula I
get
> a
> Run Time Error 13 Type Mismatch. This Criteria works when I enter it
> directly
> into the Selection Formula in Crystal and it works when I break each
> criteria
> out separately. However, when I stick them both together with an AND I
get
> the
> error.

>     Dim RecSelect1 As String, RecSelect2 As String, strAuditDate As
String,
>     Dim strBlank As String, RecSelect3 As String

>        strAuditDate = InputBox("Enter Audit Date As CCYY,MM,DD:", "Report
by
> Audit Date")
>            RecSelect1 = "{ADATA.DTAUDIT} =" & "Date(" & strAuditDate &
")"

>        strBlank = ""
>             RecSelect2 = "{ADATA.Comments}<> 'strBlank'"

>         RecSelect3 = RecSelect1 And RecSelect2
>             crysIndReport.SelectionFormula = RecSelect3

>     crysIndReport.Destination = crptToWindow
>     crysIndReport.Action = 1

> I have tried this with other fields of the same format and I still get
the
> same
> error. Do I have something wrong with my syntax in my AND.

> Very much would appreciate your advice,

> Thanks,

> Gordy Frank





Wed, 13 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using formula field in selection formula

2. Using formula field in selection formula

3. Using formula field in selection formula

4. Crystal Report Selection Formula Problem

5. Problem applying record selection formula

6. Problem passing date in selection formula

7. Problem in sending Selection Formula

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

9. Problem with Selection formula

10. SELECTION FORMULA PROBLEM-REPOST

11. SELECTION FORMULA PROBLEM-REPOST

12. selection formula problem

 

 
Powered by phpBB® Forum Software