Tabbed Table - hide Tab

Hi there,

I have a tabbed table and need to hide one of the tabs if the field on the tab is empty. There is only one field on the tab, but it is a richt text field. I have tried the hide section option, but then it won’t display it to the user automatically when the field contains information. I have also tried the computed subform option, but it still shows, whether empty or not.

Any ideas.

Thanks in advance.

Subject: Tabbed Table - hide Tab

One tab is one row in the table. One row is hidden, if all of the content is hidden. Since you cannot reliably control the hide-when-formulas for paragraphs containing RichText items, there are few options.

One way that might just work could be to place the RT field into a subform and place that on the tab as a computed subform: Only include subform, if RTItem is not empty.

Even if it works, there are still a couple of problems to solve: How do you find out, if the RT field is empty? Computed subform formulas are only evaluated when the form is loaded.

Subject: RE: Tabbed Table - hide Tab

Hi there,

Thank you for your respone, however, I have tried computed subform, but it’s not working. I have tried all sorts of things, can’t seem to get it to work.

Subject: RE: Tabbed Table - hide Tab

Hi,

In your Post Open, use the below given code:

Dim hideTab As String

On Error Goto validationCheck

  1. Call source.GotoField(your rich text field name)

  2. Call source.SelectAll

  3. Call source.DeselectAll

validationCheck:

If (Err = 4407) Then // error code for error triggered because of lines 1, 2, 3 and if RT field is empty

Call Source.FieldSetText(“hideTab”,“Yes”)

Call source.Refresh

Exit Sub

End If

create a field named “hideTab” in your form and use “@If(hideTab=“Yes”;1;0)” RT item field hide when formula (or) the row text hide formula

Subject: RE: Tabbed Table - hide Tab

Rakesh, the main cause of trouble here is, that you cannot hide a Richt Text Field using the paragraphs hide-when-formulas. The contents of Richt Text items can have their own hide-whens for every single paragraph (or even paragraphs within table cells) and they will always override whatever you set in designer.

Your code is still useful, but I would not put it in the PostOpen event of the form. I’d rather use it in the form used for editing the documents (there has to be another form, or otherwise the - hopefully - hidden RT field could never be edited) to set the flag field HideTab.

Now, Lieschen, create two subforms, one (lets call it body) containing only one line with the RT field. The other (lets call it blank) containing only one hidden line. On the tab you want to hide create a computed subform with a formula like

@If(

HideTab = “Yes”;

blank;

body

)

Also remmeber to always hide the lines above and below the computed subform, or it will not work. Now if the flag field HideTab is set to “Yes”, subform blank will be loaded. As there are just three hidden lines in the row of that tab, Notes won’t show it. If HideTab is set to anything but “Yes”, subform body will be loaded and the RT field will be displayed.

Now the main problem is to make sure that the flag field is always set correctly. It might take some fiddling with form events to make it work reliable under all circumstances.

However, note that it is still possible that the tab shows up, despite of the field appearing to be empty: Users might still apply their own hide-whens inside the RR field or simply enter a couple of new lines.

Subject: RE: Tabbed Table - hide Tab

Thanks Harkpabst, I’ll give it a go and will let you know if it works.

Thanks again.