Solved

Invalid Formula Name

Posted on 2011-03-24
3
2,025 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
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 100

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Interview question Javascript, database 12 64
A string is required here error 20 19
some keys in my laptop is not working. any suggestion 6 33
SQL Insert parts by customer 12 35
A short article about a problem I had getting the GPS LocationListener working.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

825 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