dcsimg
Results 1 to 4 of 4

Thread: Datagrid values to datareport

  1. #1

    Thread Starter
    New Member Helix.ph's Avatar
    Join Date
    Jun 2013
    Location
    PH
    Posts
    4

    Smile Datagrid values to datareport

    Hi Sirs,

    i know my question is a bit old and im still learning about vb6. i would just like to know how to put data coming form datagrid to datareport thru code.
    i have a sample code that i made and i know this is not sufficient.

    Code:
    Set DataReport1.DataSource = dbform2.dbRS
    Set DataReport1.DataMember = dbform2.dbRS("Sender").Name
    With DataReport1
    
    .Sections("Section1").Controls.Item("txtsender") = dbform2.dbRS.Fields("Sender").Value
    
    End With
    
    DataReport1.Show
    i also tried checking the web for more information about datareport and datagrid methods,properties and events.
    it would be a great help if you can post a link so i can also check on it.

    TIA.

    God Bless you all.

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,057

    Re: Datagrid values to datareport

    Quote Originally Posted by Helix.ph View Post
    i also tried checking the web for more information about datareport and datagrid methods,properties and events.
    it would be a great help if you can post a link so i can also check on it.
    See DataGrid Control.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  3. #3

    Thread Starter
    New Member Helix.ph's Avatar
    Join Date
    Jun 2013
    Location
    PH
    Posts
    4

    Re: Datagrid values to datareport

    thank you, i have seen this link. and also check other samples on the web.
    i am actually having some trouble with data report. i want to view data from data grid to data report.

    again, thank you sir bonnie

    This is my code for viewing records from datagrid to datareport
    Code:
    Private Sub Command1_Click()
    Set DataReport1.DataSource = dbform2.dbRS
    With DataReport1.Sections("Section1")
    .Controls.Item("Text1") = "Sender"
    .Controls.Item("Text2") = "RECIPIENT"
    .Controls.Item("Text3") = "AWB"
    .Controls.Item("Text4") = "QTY"
    End With
    
    DataReport1.Show
    End Sub
    for opening DBrecordset and vieiwing datagrid.

    Code:
    Set conn = New adodb.Connection
    Set dbRS = New adodb.Recordset
    dbRS.CursorLocation = adUseClient
    conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\dhl file.mdb" & ";Persist security Info=False"
    dbRS.Open "DATADHL", conn, adOpenDynamic, adLockOptimistic
    With Form1.DataGrid1
    Set .DataSource = dbRS
    i hope someone can post advice. thanks.
    Last edited by Helix.ph; Jul 16th, 2013 at 04:07 AM.

  4. #4

    Thread Starter
    New Member Helix.ph's Avatar
    Join Date
    Jun 2013
    Location
    PH
    Posts
    4

    Re: Datagrid values to datareport

    sir bonnie. thank you for the link.

    problem solved.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width