Get the report with crystal 8

Posted on 2004-04-01
Last Modified: 2010-05-02

I'm trying to print a report using Crystral 8. In VB I've this code:

Private Sub Command1_Click()
    Me.CR.SelectionFormula = "{FACTURA.num_factura}=frmfactura.textbox1.text"
    Me.CR.Action = 1
End Sub

Private Sub Form_Load()
    Me.CR.ReportFileName = "D:\dev\InFactu\proGym\Reports\Factura.rpt"
End Sub

The problem is that I get the report, but without any data. What wrong / missing.

Pls help me!  Thanks.

Question by:pinheiroa
  • 2
LVL 48

Expert Comment

ID: 10733800
Maybe your report is not attached to the right DB or theres no data to be shown
LVL 48

Expert Comment

ID: 10733841
LVL 13

Expert Comment

ID: 10736484
currently the report is only showing records, where the field {FACTURA.num_factura} has the  value "frmfactura.textbox1.text". you need to place the frmfactura.textbox1.text outside the string literal.

so try chaning this lineMe.CR.SelectionFormula = "{FACTURA.num_factura}=frmfactura.textbox1.text"

to something simliar to this if the field value is a number
Me.CR.SelectionFormula = "{FACTURA.num_factura}= " & frmfactura.textbox1.text

or if it's a string
Me.CR.SelectionFormula = "{FACTURA.num_factura}= '" & frmfactura.textbox1.text & "'"

Accepted Solution

modulo earned 0 total points
ID: 11441052
PAQed - no points refunded (of 250)

Community Support Moderator

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

828 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