0

Hi all
I hope some one copld help me with this.
I have a datareport works fine as it is
I have a report textbox txtsex
I have 2 labels Pregnancy and Children
If txtsex is Male the 2 labels captions should be ""
My present code below gives me the object does not support this property or method Error

Private Sub DataReport_Initialize()
If DataReport11.Sections("Section1").Controls.Item("txtsex") = "Male" Then

DataReport11.Sections("Section1").Controls("Label60").Caption = ""
End If
End Sub

I nave been at it for two weeks without any success.
I wish some one could enlighten me.
I am from the land of Olympic gold medallist in 400 meters and I am proud
Thanks

3
Contributors
4
Replies
7
Views
5 Years
Discussion Span
Last Post by AndreRet
1

I have eventually solved this problem.
I was trying to manipulate within data report and failed.
The data report is based on a form.
I referenced the form control in Data report for the if...Then as follows....

Private Sub DataReport_Initialize()
If frmReferral.txtFields(49).Text = "Male" Then
DataReport11.Sections("Section1").Controls("Label60").Caption = ""
DataReport11.Sections("Section1").Controls("Label61").Caption = ""
End If
End Sub

It works perfectly
Thanks every one

Votes + Comments
Nicely done on solving your own problem. Also well done to Bolt, what an athlete!! Also, please mark as solved, thanx
0

Nicely done on solving your own problem. Also well done to Bolt, what an athlete!! Also, please mark as solved, thanx

0

Hi Senior Poster AndreRet
Thanks for the compliment. We are proud of all the Caribbean athlets who took part in the 2012 0lympics and all those medallists. I am from the land of Kirani James who won a Gold medal ever for Grenada

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.