
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