Home > Archive > MS Access database support > January 2006 > A way to "hide" or not display a field when entire field is null









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author A way to "hide" or not display a field when entire field is null
jerry.ranch@pioneer.com

2006-01-26, 5:01 pm

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
jerry.ranch@pioneer.com

2006-01-27, 8:25 pm

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


david epsom dot com dot au

2006-01-29, 8:24 pm


<jerry.ranch@pioneer.com> wrote in message
news:365lt15ikj2ia1q
fd37u86pra9fsf6b4p2@
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)

>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com