Solved

Crystal Reports - How to query a certain record to print?

Posted on 2002-03-16
5
151 Views
Last Modified: 2010-05-02
How can I select a certain record from a table with Crystal Reports using VB Code.
0
Comment
Question by:Gmoney
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
trkcorp earned 50 total points
ID: 6872340
try something like this:
Crystalreport1.SelectionFormula = "({table.DateIssued} >=  Date(" & Year(txtFrom) & "," & Month(txtFrom) & _
            "," & Day(txtFrom) & ") and {table.DateIssued} <= Date(" & Year(txtTo) & "," & Month(txtTo) & _
            "," & Day(txtTo) & "))"
OR THIS:
.SelectionFormula = "{Table.Field} = " & NumericData
OR THIS:
.SelectionFormula ={Table.Field} = '" & AlpaNumericString & "'"
0
 
LVL 4

Expert Comment

by:trkcorp
ID: 6872346
Sorry for the wierd continuations... you just never know what a thing will look like when you cut & paste.
0
 

Author Comment

by:Gmoney
ID: 6872470
thanks trkcorp, it worked
0
 

Author Comment

by:Gmoney
ID: 6872806
Hey trkcorp how would I retrieved the following data

Table = Continuation_Report
Field = Case_Number
Desired record = 123456
0
 
LVL 4

Expert Comment

by:trkcorp
ID: 6873656
.SelectionFormula = "{Continuation_Report.Case_Number} = " & 123456
- OR -
Dim lNum as Long
lNum = 123456
.SelectionFormula = "{Continuation_Report.Case_Number} = " & lNum
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 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