Hide text box with format in detail section (1 Viewer)

Suresh_Murugan

Registered User
Joined
Aug 28, 2016
Messages
31
Hi all,

I was tried many times but didn't get a correct solution.
I prepared one database for project related. I have a 16 section and need 16 pages together one report in one click, everything was good. But one problem, few (1 or 2) sections is we consider not applicable, if "not applicable" pages shown "This section not applicable" in same detail section. If applicable Pages shown blank.
I want whichever pages showing "This section not applicable" text box with formatting and whichever pages not showing "This section not applicable" without formatting (means hidden text box). :banghead:
 
Last edited:

GinaWhipp

AWF VIP
Joined
Jun 21, 2011
Messages
5,596
Hmm, I'm not sure what you mean by *sheets*. I hope you are talking about Subreports. If you are something like...

Code:
    If Me.YourSubreport.Report.HasData Then
        Me.YourTextBox.Visible = True
    Else
        Me.YourTextBox.Visible = False
    End If
In the On_Format section of where the Text Boxes are located should work. If that is not what you meant going to need a little bit more, perhaps a screen shot?
 

Suresh_Murugan

Registered User
Joined
Aug 28, 2016
Messages
31
Hi Gina,
Thanks for your reply. I has been edited sheets to pages. It's not subreport
all in one report, detail section. I was tried your code but haven't get correct. Also I has attached what we need, included with page numbers.
 

Attachments

GinaWhipp

AWF VIP
Joined
Jun 21, 2011
Messages
5,596
Yeah, that code won't work for that, no Subreports. Okay, falling asleep 3:00 am where I am (and just signing off) so if I see no progress once I have gotten some sleep I'll post. In the interim. Am I understanding you just want to hide the TEXT or the entire TEXT Box (no borders)?
 

GinaWhipp

AWF VIP
Joined
Jun 21, 2011
Messages
5,596
Hmm, well I'm back! But I see you didn't get a chance to answer my question so I'll wait.
 

June7

AWF VIP
Joined
Mar 9, 2014
Messages
2,687
What data determines whether section is applicable or not? What code are you using to hide the text?
 

Suresh_Murugan

Registered User
Joined
Aug 28, 2016
Messages
31
Yeah, that code won't work for that, no Subreports. Okay, falling asleep 3:00 am where I am (and just signing off) so if I see no progress once I have gotten some sleep I'll post. In the interim. Am I understanding you just want to hide the TEXT or the entire TEXT Box (no borders)?
Hi Gine,

We need to hide entire TEXT BOX (No Borders)
 

GinaWhipp

AWF VIP
Joined
Jun 21, 2011
Messages
5,596
Okay, then what is the trigger? Is there a check box or something that indicates those Text Boxes are to be hidden? Without a trigger you are going to have do what we call *hard code* each one.
 

Suresh_Murugan

Registered User
Joined
Aug 28, 2016
Messages
31
Okay, then what is the trigger? Is there a check box or something that indicates those Text Boxes are to be hidden? Without a trigger you are going to have do what we call *hard code* each one.
Hi Gine,

This related table field name is: Sec.No[tb], Descr[tb], Status[cbo- (Not applicale)]

Then report section textbox1[](Control Source: [Status]), then another textbox(Control Source: =IIf([Text11]="(Not Applicable)","This Section is Not Applicable to this System","")).

Then when I was open report status is not applicable working good, if blank it's showing same textbox with border. Refer to attached report design view.....
 

Attachments

arnelgp

error reading drive A:
Joined
May 7, 2009
Messages
8,631
add code to the Detail's OnFormat event:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.txtBoxName.Visible = (Nz([Status],"(Not Applicable)") <> "(Not Applicable)")
End Sub
 

Suresh_Murugan

Registered User
Joined
Aug 28, 2016
Messages
31
add code to the Detail's OnFormat event:
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.txtBoxName.Visible = (Nz([Status],"(Not Applicable)") <> "(Not Applicable)")
End Sub
Hi Arnel,

Thanks for your answer.
I has been tried your module, but it was directly going to text box hidden properties.
 

arnelgp

error reading drive A:
Joined
May 7, 2009
Messages
8,631
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me.txtBoxName.Visible = (([Status] & "") <> "(Not Applicable)")
End Sub
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom