VB Crystal Report >> How to show the actual record: use of selectionformula ?

by Adriano » Thu, 28 Apr 2005 14:11:21 GMT

I would like to preview/print the data from the unique id of the actual
viewed Record
But when show CRForm it is shown always the first IDRecord of the database
and not the
actual viewed IDRecord

Why ?

Here's the code (visual basic 6 and crystal report xi)

Global IDRecordNUM as integer

' Click print button
IDrecordNUM = rs("IDRecord")
CRForm.CRViewer1.SelectionFormula = "{rs.IDRecord} in [" & IDRecordNUM &
"]"
CRForm.Show

Thenks
Adriano




Similar Threads

1. actual record - VB.Net

2. How to delete an actual table through vb (not all records)

I've been searching around for a while now trying to find how I can
delete a table through vb.

I'm using access2000.

I use this to make a table:

CurrentDb.Execute "CREATE TABLE " & StrTableName

I found plenty of refereces saying:

CurrentDb.Execute "DELETE * FROM " & StrTableName

This removes all records but not the table itself.

If someone could tell me how to delete a table without prompt I'll be
very grateful. Surely it's just a simple command.

Cheers.

3. Updating of Actual Hours in PWA doesn't show up in Project Professional

4. Headers Show up but actual rows do not when viewing Crystal Report through VB.NET

I am new to Crystal Reports development, so sorry if I do not explain
the problem well enough. I got the VB.Net program that retrieves and
view the report. It works on one computer correctly but on my machine
in development environment I can see only headers and sub table's
headers. It looks like this:

REPORT TITLE

>From Date:
To Date:

ColumnHeader1 ColumnHeader2 ColumnHeader3

SubHeader1

No rows displayed

SubHeader2

No rows displayed

The other machine retrieves data correctly with all rows

Since there is no error comes up, I am at a loss what could be wrong
between two computers. Both use Crystal libraries which come with
VS.NET 2003

Thanks.

5. using "LIKE" in SelectionFormula - VB Crystal Report

6. Show actual name of file path after you have renamed it

Hi everyone-

I am writing a code in excel VBA for word.  I am linking tables from
various excel files to one word document.  I need to specifiy which
excel file table is placed into the word document.  The code opens up
several excel files of the users choosing, renames that path to
something more general (Study Opt1FE1), and then this is where the
difficulty comes in.  I am running for loops and when a certain
combination of numbers in the for loops matches what I renamed my path
files to, the code will link that files tables to my word document.
The code for linking the tables is as follows without the renamed file
path:

Wdoc.Fields.Add Range:=rng, _
               Text:="LINK Excel.Sheet.8 ""C:\\Documents and
Settings\\shornbec\\Desktop\\sarah\\excel
templates\\Mission.FY07Q1_Sarah.xls"" ""Report Tables!CostSummaryK"" \a
\f 4 \h", PreserveFormatting:=True

I renamed the C:\\ path to something like "Study Opt1FE2".  But the
link will not work when C:\\...is replaced with Study Opt1FE2.  Is
there a way that I can have the renamed value display the  file path
name value, so I can put the old name value into my text link?

This is the code that I was trying to get the study Opt1FE1 to work.

Dim Wdoc As Word.document
Dim Wapp As Word.Application
Dim rng As Word.Range
Dim x As Integer
Dim y As Integer
 Dim vrtSelectedItem As Variant
Dim lngCount As Long
Dim tablestring As String

Sub create_document()

Set Wapp = CreateObject("Word.Application")
    Wapp.Visible = True
    Wapp.Documents.Add
    Set Wdoc = Wapp.ActiveDocument

Call UseFileDialogOpen()

End sub

Public Sub UseFileDialogOpen()

With Application.FileDialog(msoFileDialogOpen)
    .AllowMultiSelect = True
    .Show

    For lngCount = 1 To .SelectedItems.Count
        MsgBox .SelectedItems(lngCount)
    Next lngCount

'renames file path to more generic names with slight number variations
    For Each vrtSelectedItem In .SelectedItems
        Workbooks.Open vrtSelectedItem
        a = Worksheets("Report Tables Delta V").Range("B1") ' Options
        b = Worksheets("Report Tables Delta V").Range("D1") 'Flight
Elements
        vrtSelectedItem = "Study Opt" & a & "FE" & b
        MsgBox vrtSelectedItem
    Next
End With

ThisWorkbook.Activate
Worksheets("more options").Activate
x = Worksheets("more options").Range("A1")
y = Worksheets("more options").Range("A2")

For i = 1 to x
    For j = 1 to y

'i was putting together a string that could go in the text link below,
but the Study Opt1FE1 remains.  Is
'there a way to get it to display its pathname?  I just want the
studyopt1fe1 there so the code now
'where to get the specific excel file's table from.

tablestring = "LINK Excel.Sheet.8" & Chr(34) & Chr(34) & "Study Opt" &
i & "FE" & j & Chr(34) & Chr(34) & """ Report Tables Delta
V!MissionTimelineDeltaVBudgetTable"" \a \f 4 \h"

        Wdoc.Fields.Add Range:=rng, _
            Text:=tablestring, PreserveFormatting:=True

7. Getting the SelectionFormula for a view using COM and VB6

8. Headers Show up but actual rows do not when viewing Crystal Report through VB.NET

I am new to Crystal Reports development, so sorry if I do not explain
the problem well enough. I got the VB.Net program that retrieves and
view the report. It works on one computer correctly but on my machine
in development environment I can see only headers and sub table's
headers. It looks like this:

REPORT TITLE

>From Date:
To Date:

ColumnHeader1 ColumnHeader2 ColumnHeader3

SubHeader1

No rows displayed

SubHeader2

No rows displayed

The other machine retrieves data correctly with all rows

Since there is no error comes up, I am at a loss what could be wrong
between two computers. Both use Crystal libraries which come with
VS.NET 2003

Thanks