1 Attachment(s)
Master & Detail Data Report
How can I display the same Master and Detail records in DataReport, using SQL statement?
As detail recrords can be more than one, so how can I display it on report along with master record?
In this code, the master record is also repeating along with detail records.
VB Code:
Dim Rs As New ADODB.Recordset
Set Rs = conServer.Execute("SELECT * FROM MASTER, DETAIL WHERE MASTER.RecNo = DETAIL.MaterialID")
With DataReport1
.DataMember = vbNullString
Set .DataSource = Rs
.Caption = "DataReport Window"
With .Sections("Section1").Controls
.Item("txtDescription").DataField = Rs.Fields(2).Name
.Item("txtQty").DataField = Rs.Fields(3).Name
.Item("txtUnit").DataField = Rs.Fields(4).Name
.Item("txtRate").DataField = Rs.Fields(5).Name
.Item("txtAmount").DataField = Rs.Fields(6).Name
'.Item("txtMaterial").DataField = Rs.Fields(7).Name
End With
.Show
End With
Database is attached....