473,396 Members | 1,770 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1817
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).Name = "Summary" Or Left(f(intField).Name, 1) =
"_" Then
f(intField).ColumnWidth = 0
Else
f(intField).ColumnWidth = -2
End If
End If
Next

End Sub

<je*********@pioneer.com> wrote in message
news:n7********************************@4ax.com...
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).Name = "Summary" Or Left(f(intField).Name, 1) =
"_" Then
f(intField).ColumnWidth = 0
Else
f(intField).ColumnWidth = -2
End If
End If
Next

End Sub


Jan 27 '06 #3

<je*********@pioneer.com> wrote in message
news:36********************************@4ax.com...
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).Name = "Summary" Or Left(f(intField).Name, 1) =
"_" Then
f(intField).ColumnWidth = 0
Else
f(intField).ColumnWidth = -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
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...
1
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...
2
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 =...
4
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....
4
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...
0
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...
3
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...
3
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.