20515 - Error in Formula <Details> - Please HELP!!!! 
Author Message
 20515 - Error in Formula <Details> - Please HELP!!!!

Hi,

There are two USRE INPUT fields as FromID, ToID (an inquiry for
Employees' IDs in a certain range. ie From: 1234 To: 1550)

I have this code in VB5.0 for CR6.0 Pro.

Dim FromID as string    'List IDs From
Dim ToID as string      'List IDs up to
Dim IDStr as string

FromID = Str(ReportQuery.Text1.Text)
IDStr = "{EmpID.ID} >= " & FromID
IDStr = IDStr & " AND "
ToID = Str(RptQuery.Text2.Text)
IDStr = IDStr & "{EmpID.ID} <= " & ToID
.
.
.
CrystalsReport1.DataFiles(0) = "C:\BUDGET\BUDGET.MDB"
CrystalsReport1.SelectionFormula = IDStr
.
.
.
THEN I GOT THE FOLLOWING MESSAGE:
ERROR IN FORMULA < Record_Selection>
'{EmpID.ID} >= 1234 AND {EmpID.ID <= 1550'
A string is required here

MANY THANKS!

Oga



Tue, 21 Nov 2000 03:00:00 GMT  
 20515 - Error in Formula <Details> - Please HELP!!!!

Put single quotes around FromID and TolID.
Your formula should be

{EmpID.ID} >= '1234' AND {EmpID.ID <= '1550'

Quote:

>Hi,

>There are two USRE INPUT fields as FromID, ToID (an inquiry for
>Employees' IDs in a certain range. ie From: 1234 To: 1550)

>I have this code in VB5.0 for CR6.0 Pro.

>Dim FromID as string        'List IDs From
>Dim ToID as string  'List IDs up to
>Dim IDStr as string

>FromID = Str(ReportQuery.Text1.Text)
>IDStr = "{EmpID.ID} >= " & FromID
>IDStr = IDStr & " AND "
>ToID = Str(RptQuery.Text2.Text)
>IDStr = IDStr & "{EmpID.ID} <= " & ToID
>.
>.
>.
>CrystalsReport1.DataFiles(0) = "C:\BUDGET\BUDGET.MDB"
>CrystalsReport1.SelectionFormula = IDStr
>.
>.
>.
>THEN I GOT THE FOLLOWING MESSAGE:
>ERROR IN FORMULA < Record_Selection>
>'{EmpID.ID} >= 1234 AND {EmpID.ID <= 1550'
>A string is required here

>MANY THANKS!

>Oga



Tue, 21 Nov 2000 03:00:00 GMT  
 20515 - Error in Formula <Details> - Please HELP!!!!

CRW seems a bit fussy on how you tell it things ... here is a statement
which works... substitute your variables  and try again (I think it's
telling you that it wants a REAL string and not a variable As String?)

CrystalsReport1.SelectionFormula = "{member.NEWS} =  'Y' and {member.YEAR}

Quote:
>= " & iStartYear & " and {member.YEAR} <= " & iYear

cheers
Neil

Quote:
> Hi,

> There are two USRE INPUT fields as FromID, ToID (an inquiry for
> Employees' IDs in a certain range. ie From: 1234 To: 1550)

> I have this code in VB5.0 for CR6.0 Pro.

> Dim FromID as string       'List IDs From
> Dim ToID as string 'List IDs up to
> Dim IDStr as string

> FromID = Str(ReportQuery.Text1.Text)
> IDStr = "{EmpID.ID} >= " & FromID
> IDStr = IDStr & " AND "
> ToID = Str(RptQuery.Text2.Text)
> IDStr = IDStr & "{EmpID.ID} <= " & ToID
> CrystalsReport1.DataFiles(0) = "C:\BUDGET\BUDGET.MDB"
> CrystalsReport1.SelectionFormula = IDStr



Sat, 25 Nov 2000 03:00:00 GMT  
 20515 - Error in Formula <Details> - Please HELP!!!!

Since the Employee ID is a string variable - there needs to be single
quotes around it.  So the line would look like this:
            IDStr = IDStr & "{EmpID.ID} <= '12345'"                 with a
value

        IDStr = IDStr & "{EmpID.ID} <= '" & ToID & "'"        with a variable

SMDavis



Quote:
> CRW seems a bit fussy on how you tell it things ... here is a statement
> which works... substitute your variables  and try again (I think it's
> telling you that it wants a REAL string and not a variable As String?)

> CrystalsReport1.SelectionFormula = "{member.NEWS} =  'Y' and
{member.YEAR}
> >= " & iStartYear & " and {member.YEAR} <= " & iYear

> cheers
> Neil

> > Hi,

> > There are two USRE INPUT fields as FromID, ToID (an inquiry for
> > Employees' IDs in a certain range. ie From: 1234 To: 1550)

> > I have this code in VB5.0 for CR6.0 Pro.

> > Dim FromID as string  'List IDs From
> > Dim ToID as string    'List IDs up to
> > Dim IDStr as string

> > FromID = Str(ReportQuery.Text1.Text)
> > IDStr = "{EmpID.ID} >= " & FromID
> > IDStr = IDStr & " AND "
> > ToID = Str(RptQuery.Text2.Text)
> > IDStr = IDStr & "{EmpID.ID} <= " & ToID

> > CrystalsReport1.DataFiles(0) = "C:\BUDGET\BUDGET.MDB"
> > CrystalsReport1.SelectionFormula = IDStr



Sun, 26 Nov 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. 20515 - Error in Formula <Record_Selection> - HELP PLEASE....PLEASE!!!!

2. StreamReader Error - Please help :) <details inside>

3. Error 20515 error in formula

4. <<<<<<<<ComboBox>>>>>>>>>>>>

5. Error 20515, on selection formula?

6. HELP >>>>>>WIN API <<<<<<<<<<

7. >>>>> URGENT: PLEASE HELP <<<<<

8. Help recasting UDT <<PLEASE!>>

9. help me out please!!!!<<<<<<<<<<<<<<<<<<<<<<<thanks>>>>>>>>>>>>>>>>>>>>>>>>

10. <><><>HELP<><><> PCMCIA Motorola Montana 33.6

11. >>>>HELP ME WITH DATEVALUE IN UK FORMAT<<<<<<<

12. <<<<HELP- OLE container Control>>>>>>>>>

 

 
Powered by phpBB® Forum Software