0

How do i generate one data report fom multple tables.I have four tables each with a primary key.I require a master report for this data in this tables.Anyone know how to do it?Am using vb6 and access.Thanx

3
Contributors
2
Replies
5
Views
10 Years
Discussion Span
Last Post by jireh
0

Hi,

If you go into access an create the report you want based on a query. Then call query/report from VB6.

Denis

0

hi lasherz2,

first is you'll make a query in your access,select the tables you want to create and put all their fields that you are needed.

In your VB make a query command that joins the table
i.e.

On Error Resume Next
Dim qryDef As QueryDef
Dim de As New Dev
Dim str As String

Set qryDef = dbase.QueryDefs("TABLE1Query")
dbase.QueryDefs.Refresh

If Err.Number = 3265 Then
Set qryDef = dbase.CreateQueryDef("TABLE1Query")
dbase.QueryDefs.Refresh
End If

str = "select TABLE1.Id,TABLE2.Id from [TABLE1] LEFT JOIN TABLE1.Id on TABLE2.Id where TABLE1.Id=TABLE2.Id "

qryDef.SQL = str

Set de = New DetaEnvironment1
Set StickerReport.DataSource = de
StickerReport.DataMember = "Query Command"

StickerReport.Show 1

Err = 0
Set de = Nothing
Unload Dev

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.