try this

With CrystalReport1
        .ReportFileName = App.Path & "\YourRPT.rpt"
        .Connect = "DSN=test;UID=sapest;PWD=sapest;DSQ=Sage;"
        .DiscardSavedData = True
        .RetrieveDataFiles
        .ReportSource = 0
        .SQLQuery = "Select * from yourtable"
        .ReportTitle = "Report Title"
        .Destination = crptToWindow
        .PrintFileType = crptCrystal
        .WindowState = crptMaximized
        .WindowMaxButton = False
        .WindowMinButton = False
 'if you want to filter report based on some parameter fields, you can use SelectionFormula property
        .SelectionFormula = "{table.field} =" & Trim(Txt.Text) & ""      
        .Action = 1
    End With

Hi,

Open the Report in CR Designer and Inseret a New FormulaField and Place it on the report..
And from VB6 just before Viewing the report, write this code:

Report.FormulaFields(0).Text = "'" & Text1.Text & "'"

Regards
Veena

Hi,

You can also try this :

Report.FormulaFields.GetItemByName("MyFormulaname" ).Text = "'" & text1.text & "'"

Regards
Veena

This question has already been answered. Start a new discussion instead.