Results 1 to 4 of 4

Thread: Passing Value to Data Report

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    219

    Passing Value to Data Report

    Hai Friends and Gurus,

    Please tell how to pass the value to data report during run time.

    Code:
     Private Sub Command2_Click()
    Dim ssq   As String
       
        Set cn1 = New ADODB.Connection
        Set rse = New ADODB.Recordset
    
        cn1.Provider = "Microsoft.Jet.OLEDB.3.51;"
        cn1.ConnectionString = "Persist Security Info=false;" _
            & "Data Source=D:\postcost\inve.mdb"
        
        cn1.Open
        ssq = "Select * From inve where edate = # " & Text1.Text & " # "
        rse.Open ssq, cn1, adOpenDynamic, adLockOptimistic
        Set DataReport1.DataSource = rse
        DataReport1.Show
    End Sub
    While printing the Data Report - In the title the Text1.text's date value to be displayed.

    Thanks in advance.
    Saravanan.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Passing Value to Data Report

    DataReport1.Title = Text1.Text

    If you are wanting to set the value of an unbound control use something like

    Datareport1.Sections("Section2").Controls("Label1").Caption = "Hello World"

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Passing Value to Data Report

    Moved to reporting

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jun 2006
    Posts
    219

    Re: Passing Value to Data Report

    Thanks friends,

    I am not getting clear result for this...please advice

    I enter the following code :

    vb Code:
    1. DataReport1.Sections("Section4").Controls("Label3").Caption = #" & Text1.Text & "#

    Still Error on # Symbol. if removed the # in both side & Text1.Text -only in display

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