Get the report with crystal 8

Posted on 2004-04-01
Medium Priority
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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, 5 hours left to enroll

840 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