We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,737 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

VB6 DataReport

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
4 Days
Discussion Span
9 Months Ago
Last Updated
5
Views
stillmarooned
Newbie Poster
4 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

stillmarooned
Newbie Poster
4 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

AndreRet
Industrious Poster
4,706 posts since Jan 2008
Reputation Points: 391
Solved Threads: 481
Skill Endorsements: 20

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

marooned
Newbie Poster
2 posts since Aug 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

It's a pleasure. Well done to the guys, they have a strong team. :)

AndreRet
Industrious Poster
4,706 posts since Jan 2008
Reputation Points: 391
Solved Threads: 481
Skill Endorsements: 20

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0635 seconds using 2.63MB