Solved

Invalid Formula Name

Posted on 2011-03-24
3
2,110 Views
Last Modified: 2012-05-11
Getting Error
Run Time Error 20510
Invalid Formula Name

formula name is TTLBAmt  in crystal report

CrystalReport1.Formulas(1) = "TTLBAmt = " & TTLOutStandingAmt & "
0
Comment
Question by:crystal_Tech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Author Comment

by:crystal_Tech
ID: 35206979

Code i am using
CrystalReport1.ReportFileName = App.Path & "\TPTLedger.rpt"
    CrystalReport1.Connect = con
    CrystalReport1.DiscardSavedData = True
    CrystalReport1.RetrieveDataFiles
    
    If Text1.text = "" Then
        CrystalReport1.SelectionFormula = "{TPT_Ledger.M_Date} >= date(" & Year(DTPickerFrom.Value) & "," & Month(DTPickerFrom.Value) & "," & Day(DTPickerFrom.Value) & ") And {TPT_Ledger.M_Date} <= date(" & Year(DTPickerTo.Value) & "," & Month(DTPickerTo.Value) & "," & Day(DTPickerTo.Value) & ")"
    Else
        CrystalReport1.SelectionFormula = "{TPT_Ledger.G_Name} = '" & Text1.text & "' and {TPT_Ledger.M_Date} >= date(" & Year(DTPickerFrom.Value) & "," & Month(DTPickerFrom.Value) & "," & Day(DTPickerFrom.Value) & ") And {TPT_Ledger.M_Date} <= date(" & Year(DTPickerTo.Value) & "," & Month(DTPickerTo.Value) & "," & Day(DTPickerTo.Value) & ")"
    End If
    CrystalReport1.Password = Chr(10) & "*******"
    CrystalReport1.WindowState = crptMaximized
    CrystalReport1.Destination = crptToWindow
    CrystalReport1.Action = 1
    CrystalReport1.PageZoom 125

Open in new window

0
 
LVL 101

Accepted Solution

by:
mlmcc earned 125 total points
ID: 35207010
Have you tried

CrystalReport1.Formulas(1).Text = " 'TTLBAmt = " & TTLOutStandingAmt & " ' "

or

CrystalReport1.Formulas(1).Text = "TTLBAmt = " & TTLOutStandingAmt & ""

mlmcc
0
 

Assisted Solution

by:benny_ca
benny_ca earned 125 total points
ID: 35207140
You start the code with

CrystalReport1.Reset

and then CrystalReport1.formulas(0)= "TTLBAmt = " & TTLOutStandingAmt & "
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Progress
Starting up a Project

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question