Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataReport Populate Labels when unbound 1

Status
Not open for further replies.

DK47

Programmer
Jun 3, 2003
118
0
0
US
Hi,
I used the code below to load data into a DataReport based on an ado recordset. I did this because my user needs to select reports based on investor ID's and other run time citeria.
This works well enough but now I can't figure out how to populate the labels which are not datbase connected.


Private Sub cmdHistory_Click()
frmDataReports.adoHistory.RecordSource = "SELECT * FROM History WHERE Investor_Number = " & frmStartPage.txtInvestorNumber & " Order By Date DESC"
frmDataReports.adoHistory.Refresh


Dim rsClone As ADODB.Recordset
Set rsClone = frmDataReports.adoHistory.Recordset.Clone
Set drHistory.DataSource = rsClone

drHistory.Show


End Sub

This is an example of the string needed to populate the Header. This raises an error. I tried using the "Set" keyword ahead of the statement. Also raises an error.

drHistory.Sections("ReportHeader").Controls.Item("lblInvestorName").Caption = lblInvestorName


Any suggestions would be greatly appreciated.
Regards,
Dwight


"The more I learn, the smarter you guys get."
 
Where are you using this:
<drHistory.Sections(&quot;ReportHeader&quot;).Controls.Item(&quot;lblInvestorName&quot;).Caption = lblInvestorName>

Try putting this before you do the drHistory.Show:
drHistory.Sections(&quot;ReportHeader&quot;).Controls.Item(&quot;lblInvestorName&quot;).Caption = &quot;TestString&quot;

When that shows up OK, check the value of the variable you're using

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
john,
That did the trick.
Thanks a bunch.
Dwight
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top