Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selection from multiple tables

Status
Not open for further replies.

sjors

Programmer
Aug 22, 2001
4
NL
Hello,

I'm using VB 5 with Crystal Reports 4.16. I'm a newbie with this :)

I got a problem to select the right information from 4 tabels, linked by the same fieldname.

e.g.

Table 1 - Defect
Defect_ID
Defect_Name
Description
...

Table 2 - DefectHistory
Date
Defect_ID
...

Table 3 - Keywords
Keywords
Defect_ID
...

Table 4 - Symptoms
Symptom
Defect_ID

First I want to select the right defect from tabel 1 by defect_name. With this defect_name there's a unique Defect_ID. With this defect_ID I want to select data from the other 3 tables.

At this moment my VB-code looks like this and nothing happens...

Y = frmSQASFR.cboFoutNummer.ListIndex

If optCurrent.Value = True Then
If optFull.Value = True Then
CrystalReport1.ReportFileName = App.Path & "\full.rpt"
strSFR = frmSQASFR.cboFoutNummer.List(Y)
CrystalReport1.SelectionFormula
= "{Defect.Defect_Name} = " & strSFR & " and
{Dfcthist.Defect_ID} = {Defect.Defect_ID} and
{Dfctkeys.Defect_ID} = {Defect.Defect_ID} and
{Dfctsymp.Defect_ID} = {Defect.Defect_ID}"
CrystalReport1.PrintReport
ElseIf optOverview.Value = True Then
CrystalReport1.ReportFileName = App.Path & "\overview.rpt"
strSFR = frmSQASFR.cboFoutNummer.List(Y)
CrystalReport1.SelectionFormula = "{Defect.Defect_Name} =" & strSFR & ""
CrystalReport1.PrintReport
End If

As you can see, the formula is long and something tells me it's not right, but I don't knwo what to do.

So, who can help me with this????!!!!

Greetz,

Sjors

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top