Results 1 to 1 of 1

Thread: Master & Detail Data Report

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2004
    Posts
    35

    Question 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:
    1. Dim Rs As New ADODB.Recordset
    2. Set Rs = conServer.Execute("SELECT * FROM MASTER, DETAIL WHERE MASTER.RecNo = DETAIL.MaterialID")
    3.  
    4. With DataReport1
    5.     .DataMember = vbNullString
    6.     Set .DataSource = Rs
    7.     .Caption = "DataReport Window"
    8.  
    9.     With .Sections("Section1").Controls
    10.         .Item("txtDescription").DataField = Rs.Fields(2).Name
    11.         .Item("txtQty").DataField = Rs.Fields(3).Name
    12.         .Item("txtUnit").DataField = Rs.Fields(4).Name
    13.         .Item("txtRate").DataField = Rs.Fields(5).Name
    14.         .Item("txtAmount").DataField = Rs.Fields(6).Name
    15.         '.Item("txtMaterial").DataField = Rs.Fields(7).Name
    16.     End With
    17.     .Show
    18. End With

    Database is attached....
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width