|
-
Aug 29th, 2000, 10:20 AM
#1
Thread Starter
Addicted Member
Howdy!
Is it possible to have 2 data sources on a Data Report?
The reason I am asking is because I need to put 2 seperate tables in the same detail section.
Example:
Dim cn As New ADODB.Connection
Dim rs,rs2 As New ADODB.Recordset
Dim cmd,cmd2 As New ADODB.Command
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Test.mdb;"
With cmd
.ActiveConnection = cn
.CommandType = adCmdText
.CommandText = "Select * from tbl1 order by tbl1.Index"
.Execute
End With
With cmd2
.ActiveConnection = cn
.CommandType = adCmdText
.CommandText = "Select * from tbl2 order by Index"
.Execute
End With
With rs
.ActiveConnection = cn
.CursorLocation = adUseClient
.Open cmd
End With
With rs2
.ActiveConnection = cn
.CursorLocation = adUseClient
.Open cmd2
End With
Dim q As Integer
Dim intCtrl As Integer
Dim X As Integer
Dim z As Integer
X = 0
q = 1
z = 1
With DR
Set .DataSource = rs
.DataMember = ""
With .Sections("Section1").Controls
For intCtrl = 1 To .Count
If TypeOf .Item(intCtrl) Is RptTextBox Then
.Item(intCtrl).DataMember = ""
.Item(intCtrl).DataField = rs(z).Name
End If
Next intCtrl
End With
End With
With DR
Set .DataSource = rs2
.DataMember = ""
With .Sections("Section1").Controls
For intCtrl = 3 To .Count
If TypeOf .Item(intCtrl) Is RptTextBox Then
.Item(intCtrl).DataMember = ""
.Item(intCtrl).DataField = rs2(q).Name
q = q + 1
End If
Next intCtrl
End With
End With
If I set the dr.Datasource to rs2, it loses connection with rs. If anyone has any suggestions, it would be great!
Thanx
-
Aug 29th, 2000, 10:47 AM
#2
Addicted Member
can't you just create one recordset to return the information from both tables? if you need help post your sql for both recordsets and I'll see if I can help.
-
Aug 29th, 2000, 10:53 AM
#3
Thread Starter
Addicted Member
I need to select * from table1 and then select * from table2, but they have nothing in common.
-
Aug 29th, 2000, 11:00 AM
#4
Addicted Member
Then I don't know... as far as I know it isn't possible with the data reporter... maybe you could do it with crystal but I don't know as I haven't really used it much.
Just out of curiosity what kind of information would you want to display in the details area that doesn't have anything at all in common with the rest of the information?
-
Aug 29th, 2000, 11:05 AM
#5
Thread Starter
Addicted Member
Basically it is just Quantity and Length with a memo field.
the memo field is the seperate recordset(table2)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|