Solved

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

Posted on 2002-03-16
5
147 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
  • 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

759 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now