Results 1 to 6 of 6

Thread: HelP~~ Data Report got problem when read data from multiple database table...

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2007
    Posts
    445

    HelP~~ Data Report got problem when read data from multiple database table...

    Can Data Report read data from diffrent table...???
    because when at final set the Report.DataSource can only set to one record set... if I wan read from two table I ahve two record set......

    Data Report can read data into label?? like Report.Label1.Caption= xxx ...??

    Code:
    Dim sqlcom As String
    Dim rscom As New ADODB.Recordset
    
    sqlcom = "SELECT * FROM Company"
    rscom.Open sqlcom, Conn
    
    With Report.Sections("Section1").Controls
    .Item("Text7").DataField = rscom("CompanyName").Name
    .Item("Text8").DataField = rscom("Address").Name
    End With
    
    
    Dim rsPrint As New ADODB.Recordset
    Dim strPrint As String
    
    strPrint = "SELECT * FROM QuoDetail"
    rsPrint.Open strPrint, Conn
    
    With Report.Sections("Section1").Controls
    .Item("Text1").DataField = rsPrint("ItemNo").Name
    .Item("Text2").DataField = rsPrint("ItemDescription").Name
    .Item("Text3").DataField = rsPrint("Quantity").Name
    End With
    
    Set Report.DataSource = rsPrint
    Load Report
    Last edited by wenight; Jul 23rd, 2007 at 07:15 AM.

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