473,792 Members | 2,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A way to "hide" or not display a field when entire field is null

I'm building my own crosstab table.

If a crosstab field has no data in the entire field (as a result of
filtering), I don't want to show that field. Is there a way to do
this in a qry or frm object?
I'd use a pivot, but PT are too slow, and they sometimes crash with
amount of data (rows and columns) I'm talking about ..or I get an
exceeds capacity error message.
Thanks
Jerry
Jan 25 '06 #1
3 1845
In a data sheet view, set the column names blank, then
auto fit the columns. This sample also shows how to
hide some named fields. In data sheet view, hidden
columns are just columns with width 0.

Setting all the column names to blank is an odd thing
to do, but your alternative is checking all records for
non-null values.

(david)
Sub gsbBS_AutoFit(f As Form)
'(david)
Dim intField As Integer

For intField = 0 To f.Count - 1
If TypeOf f(intField) Is Label Then
Else
If f(intField).Nam e = "Summary" Or Left(f(intField ).Name, 1) =
"_" Then
f(intField).Col umnWidth = 0
Else
f(intField).Col umnWidth = -2
End If
End If
Next

End Sub

<je*********@pi oneer.com> wrote in message
news:n7******** *************** *********@4ax.c om...
I'm building my own crosstab table.

If a crosstab field has no data in the entire field (as a result of
filtering), I don't want to show that field. Is there a way to do
this in a qry or frm object?
I'd use a pivot, but PT are too slow, and they sometimes crash with
amount of data (rows and columns) I'm talking about ..or I get an
exceeds capacity error message.
Thanks
Jerry

Jan 26 '06 #2
So David
I'd run this as an on open event, right?
Jerry
In a data sheet view, set the column names blank, then
auto fit the columns. This sample also shows how to
hide some named fields. In data sheet view, hidden
columns are just columns with width 0.

Setting all the column names to blank is an odd thing
to do, but your alternative is checking all records for
non-null values.

(david)
Sub gsbBS_AutoFit(f As Form)
'(david)
Dim intField As Integer

For intField = 0 To f.Count - 1
If TypeOf f(intField) Is Label Then
Else
If f(intField).Nam e = "Summary" Or Left(f(intField ).Name, 1) =
"_" Then
f(intField).Col umnWidth = 0
Else
f(intField).Col umnWidth = -2
End If
End If
Next

End Sub


Jan 27 '06 #3

<je*********@pi oneer.com> wrote in message
news:36******** *************** *********@4ax.c om...
So David
I'd run this as an on open event, right?
Jerry


Yes, or after changing the recordsource, or after
applying a filter.

You can save the column names to an array so that
you can put them back after you have adjusted the
column width. (We get our column names from a
table anyway).

(david)
In a data sheet view, set the column names blank, then
auto fit the columns. This sample also shows how to
hide some named fields. In data sheet view, hidden
columns are just columns with width 0.

Setting all the column names to blank is an odd thing
to do, but your alternative is checking all records for
non-null values.

(david)
Sub gsbBS_AutoFit(f As Form)
'(david)
Dim intField As Integer

For intField = 0 To f.Count - 1
If TypeOf f(intField) Is Label Then
Else
If f(intField).Nam e = "Summary" Or Left(f(intField ).Name, 1) =
"_" Then
f(intField).Col umnWidth = 0
Else
f(intField).Col umnWidth = -2
End If
End If
Next

End Sub

Jan 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
23046
by: ASGMikeG | last post by:
Hi, I'm upgrading an application from VB6 to .NET. It used tab controls in VB6 to achieve a tab dialogue / wizard type effect - navigating from one tab to the next as the user filled in information. When this has upgraded to .NET the user can suddenly click on the other tabs without having completed the previous tabs i.e. the other tabs are not disabled - only the controls on them are. How do I disable and/or hide a tab page so that...
1
4239
by: Marc Scheuner [MVP ADSI] | last post by:
Folks, I've created a descendant of ListView, and I would like to be able to tell it to "hide" two of the base class's properties - how can I accomplish this? I know I can add a attribute to the properties to remove them from the object inspector window - that's not all, though - I'd like to make them unavailable from code, too.
2
2218
by: | last post by:
I have a page where I have 3 combo boxes listed in a column. sort of like: combo1 combo2 combo3 Based on which one is clicked, the others are supposed to hide (i.e. combobox.visible = false). However, when I have the bottom one in that column to be the one to be used
4
3587
by: Greg Cyrus | last post by:
Hi, in a Page_Load I use: Response.Redirect("http://localhost/WebApplication3/frmDefault.aspx") Now the IExplorer shows "http://localhost/WebApplication3/frmKopf.aspx" in the adress-field. Is the name "localhost" shown in my ieplorer only - if not how can I rename it (or shouldn't I). Greg.
4
9724
by: lcifers | last post by:
Is there a way, through VB.NET, to determine if the user has selected this option? I am writing an application that does some string functions to rename files, and the file names get chopped up if the expected extension is not returned. I can write another function to get around this, but if there is a clean way to determine the state of that toggle I would rather do that. I may need this again in the future and don't want to always...
0
1276
by: Michel Couche | last post by:
Hello, I use a datalist to display the results of a search in a database of wines. One of the fields contains a full decsription of the wines. When a visitor makes a search, the results are displayed in a datalist. By default, I do not display the full description of the wines but this should be possible by clicking on a "View details" link. I am looking for a javascript to "hide/show" a panel with the optional field. I remember that...
3
8856
by: deciacco | last post by:
I'm trying to write a label printing SDI app with a small preview on the main form itself. Every time I run the InvalidatePreview event on the preview control to redraw the preview I get the "Generating Previews" dialog box while the preview is being generated. I want to suppress this. I've been able to find this from another forum: "The 'Generating Previews' dialog is shown while calculating the layout for pages in OnPaint(). One of our...
3
2220
by: vingomail | last post by:
Let me know how to hide the "__do javascript postback" in the bottom of the browser. it occurs when the user clicks link button or button control and so on
0
9670
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10430
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10159
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.