?
Solved

Invalid Formula Name

Posted on 2011-03-24
3
Medium Priority
?
2,293 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 101

Accepted Solution

by:
mlmcc earned 500 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 500 total points
ID: 35207140
You start the code with

CrystalReport1.Reset

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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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 how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 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