Solved

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

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
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…

815 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

11 Experts available now in Live!

Get 1:1 Help Now