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.
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"
Re: Passing Value to Data Report
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:
DataReport1.Sections("Section4").Controls("Label3").Caption = #" & Text1.Text & "#
Still Error on # Symbol. if removed the # in both side & Text1.Text -only in display