|
-
Aug 9th, 2012, 11:34 AM
#1
Thread Starter
New Member
[RESOLVED] VB6 Datareport
Hi all Greetings!
I would like some help with the following.
I have a datareport based on data member Command. This has many fields all work very well.
I have 2 fields, Pregnancy and Num. of Children.
If sex field is Female then it will show Preg. and num. of children which is correct
It also shows Pre. and Num. of children for sex male also.
If Sex field is Male then pregnancy and Num. of Children field should not be visible
Can you help me to do this
Thanks and regards
marooned2012
-
Aug 10th, 2012, 09:29 PM
#2
Thread Starter
New Member
Re: VB6 Datareport
hi all
I posted this new thread 2 days ago and I have spent many many hours working on his without any positive outcome. I would appreciate any help immensely. if any clarification is needed I will try to explain the best way I know.
Thank you all
-
Aug 11th, 2012, 01:32 PM
#3
Frenzied Member
Re: VB6 Datareport
This needs proper validation .did you write anything to validate sex ?.you need to check if sex is male .then no need to check pregnancy .
-
Aug 11th, 2012, 05:25 PM
#4
Thread Starter
New Member
Re: VB6 Datareport
Hi Firoz.raj
Thanks for taking time to reply.
>>did you write anything to validate sex ?.you need to check if sex is male
Where do I validate Sex
I changed the DataFormat for Preg. and Children -- Instead of Numbers changed to Cutom Format #. Now those text boxes are ok. But still relevant Labels still appear.
This is part of the code I have but it is not working. Fires a "object does not support 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
What I need to do now is, based on txtsex or Text2 or Text 3 value I want to set Label Captions ""
thanks again
-
Aug 12th, 2012, 11:49 AM
#5
Thread Starter
New Member
Re: VB6 Datareport
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
-
Aug 12th, 2012, 04:12 PM
#6
Frenzied Member
Re: VB6 Datareport
it seems problem solved if so .please go to thread tools .and click Mark Thread resolved .else
Code:
Private Sub DataReport_Initialize()
If frmReferral.txtFields(49).Text = "Male" Then
DataReport11.Sections("Section1").Controls("Label60").Caption = ""
DataReport11.Sections("Section1").Controls("Label61").Caption = ""
Elseif frmReferral.txtFields(49).Text = "Female" then
DataReport11.Sections("Section1").Controls("Label60").Caption = "Preganancy" 'i am not sure .how you are input the data using form.
End If
End Sub
-
Aug 12th, 2012, 10:16 PM
#7
Thread Starter
New Member
Re: VB6 Datareport
 Originally Posted by firoz.raj
it seems problem solved if so .please go to thread tools .and click Mark Thread resolved .else
Code:
Private Sub DataReport_Initialize()
If frmReferral.txtFields(49).Text = "Male" Then
DataReport11.Sections("Section1").Controls("Label60").Caption = ""
DataReport11.Sections("Section1").Controls("Label61").Caption = ""
Elseif frmReferral.txtFields(49).Text = "Female" then
DataReport11.Sections("Section1").Controls("Label60").Caption = "Preganancy" 'i am not sure .how you are input the data using form.
End If
End Sub
Hi Firoz.raj
Thanks for the reply. I have previously referenced forms to gather information from other forms. This thought came to mind and it worked. I did not have to use Elseif because When textfield value is not Male it functions in the normal way. I tested it many times and works perfectly. Thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|